From 6398435769684101244
X-Google-Thread: 7894ca11fe,b8f03ff37c64f88c
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: Nikolay Ivchenkov <tsoae@mail.ru>
Newsgroups: comp.std.c++
Subject: Re: No cbegin/cend for std::initializer_list?
Date: Wed,  2 Sep 2009 17:42:08 CST
Organization: http://groups.google.com
Lines: 21
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <2e617b47-bbb5-4768-b1d6-bc786cbb8fae@c37g2000yqi.googlegroups.com>
References: <7.0.0.16.2.20090901101108.063e9c28@aristeia.com>
  <1b8b2c5d-7f06-46c5-b403-50aad13632cf@o36g2000vbl.googlegroups.com>
  <0081c572-9bbe-457e-9f54-b97da4ebfae0@v36g2000yqv.googlegroups.com>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain; charset=KOI8-R
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Wed, 2 Sep 2009 11:20:29 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:1337

On 2 ���, 21:38, "Philipp M." <bootsare...@googlemail.com> wrote:
> Could you outline a few situations were usage of the members might
> lead to unexpected problems afterwards?

This approach will not work properly with old-style classes those
represent ranges. Furthermore, if we are talking about the use of
std::initializer_list, we should note that std::initializer_list is
simple kind of range (it is not a container). In general, range can be
represented by built-in array, pair of iterators packed in std::pair
or std::tuple, container, std::initializer_list, or other special
range-class. Well-designed generic code, that works with an abstract
range, should support all these categories. Direct use of member
"cbegin" will entail pointless limitations on use of such code.


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



