From -7302955218474095846
X-Google-Thread: f78e5,ac8f7c796c0ee2eb
X-Google-Attributes: gidf78e5,public,usenet
X-Google-Language: ENGLISH,ASCII
Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 17 Nov 2007 10:00:17 -0600
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
X-SMTP-Auth: no
From: James Kanze <james.kanze@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: std::pair istream >> operator
Organization: http://groups.google.com
Message-ID: <92a741eb-f9f2-40dc-b252-5f53a451af13@w34g2000hsg.googlegroups.com>
References: <a7eb92bf-1ab8-438d-8bca-b6f7cfcc056c@o6g2000hsd.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: groups-abuse@google.com
Complaints-To: groups-abuse@google.com
Injection-Info: w34g2000hsg.googlegroups.com; posting-host=86.76.97.27; 
	posting-account=1W_PtwoAAAA1QoMcl2Z5P6j-DNc8HR3W
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) 
	Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe)
Content-Disposition: inline
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.csse.unimelb.edu.au id lAHB0mNV016019
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Date: Sat, 17 Nov 2007 09:55:09 CST
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-BktMdishORionbrEebBXVd+XT7rQ60XhI98rcLaCTFFEliQ2Q5LrKG7RoZD42DAvLaIkrZ/NHv4w+eZ!pBrBveBvH31d2SNwBloAtlz39Q58GSbkP12y+Ak4r+ykbtWjMlG8QdrDM8II61gtEBlPgUdP5UpS!DJdYyYoeGt6YOQTyjZhOnsi4unw=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.36
Xref: g2news1.google.com comp.std.c++:9639

On Nov 16, 6:24 pm, Andrey <andrey_rya...@bk.ru> wrote:

> I'm wondering why there is no standard operator defined like the
> following?

> template<typename First, typename Second>
> istream & operator >> (istream & in, pair<First, Second> & p) {
>         return in>>p.first>>p.second;
> }

And how would you define it?  To do what?

> I always define it by hand.

I never use std::pair to begin with, so the problem doesn't come
up.  If I did, I would also define it by hand.  But I see no
reason to suppose that the definition would always be the same.

--
James Kanze (GABI Software)             email:james.kanze@gmail.com
Conseils en informatique orient�e objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place S�mard, 78210 St.-Cyr-l'�cole, France, +33 (0)1 30 23 00 34

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



