From -8236745899802908998 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,2340bb60e0f0f248 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2002-02-20 14:15:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: pdimov@mmltd.net (Peter Dimov) Newsgroups: comp.std.c++ Subject: Re: proposal for resolution of "valarray operator[] const returning value" (closed isuue 77) Date: Wed, 20 Feb 2002 22:13:53 GMT Organization: http://groups.google.com/ Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <7dc3b1ea.0202201107.6adbbf61@posting.google.com> References: <3c6c03e9.287237645@news.easynet.co.uk> X-Trace: mail2news.demon.co.uk 1014243243 mail2news:14149 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 20 Feb 2002 19:08:00 GMT Lines: 24 Xref: archiver1.google.com comp.std.c++:9719 Gabriel Dos Reis wrote in message news:... > I think you're misunderstanding the fundamental problem: The problem > at hand isn't what is happening inside valarray<>, it concerns what is > happining in the use of valarray<>s. The following doesn't work: > > // a hook for, say, an external Fortran library > // The data pointed by the argument as guaranteed not to be > // modified, just inspected. > extern "C" void do_somejob(const double*, size_t, double*); > > void f(const valarray& a, valarray& b) > { > do_somejob(&a[0], a.size(), &b[0]); > } Would introducing a data() member function solve this problem, or the problem in general? --- [ 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.research.att.com/~austern/csc/faq.html ]