Re: std::pair<,>
From: Jonathan Mcdougall (jonathanmcdougall_at_DELyahoo.ca)
Date: 10/04/03
- Next message: Jonathan Mcdougall: "Re: tcp packet overflow"
- Previous message: WW: "Re: [OT] Re: to guru : strange C++ operator behaviour"
- In reply to: Mike Wahler: "Re: std::pair<,>"
- Next in thread: Mike Wahler: "Re: std::pair<,>"
- Reply: Mike Wahler: "Re: std::pair<,>"
- Reply: Neil Zanella: "Re: std::pair<,>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 3 Oct 2003 21:18:18 -0400
> > So, if you want a Point with members x and
> > y, why not subclass?
>
> Why not simply:
>
> std::pair<int,int> coord(x,y);
>
> or if you like:
>
> typedef std::pair<int,int> Point;
>
> Point coord(x,y);
The thig is
coord.first = 2;
is not quite representative, as opposed to
coord.x = 2;
Jonathan
- Next message: Jonathan Mcdougall: "Re: tcp packet overflow"
- Previous message: WW: "Re: [OT] Re: to guru : strange C++ operator behaviour"
- In reply to: Mike Wahler: "Re: std::pair<,>"
- Next in thread: Mike Wahler: "Re: std::pair<,>"
- Reply: Mike Wahler: "Re: std::pair<,>"
- Reply: Neil Zanella: "Re: std::pair<,>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|