public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/3247
@ 2001-06-27  1:16 Gabriel Dos Reis
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Dos Reis @ 2001-06-27  1:16 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/3247; it has been noted by GNATS.

From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
Cc: bkoz@gnu.org, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/3247
Date: 27 Jun 2001 10:08:32 +0200

 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de> writes:
 
 | This is a known (IMHO mis-) "feature" of the slice or
 | gslice interface of the ISO standard. This is because the C++ standard
 | library does not specify that valarray subsets provide the same
 | operations as valarrays.
 
 
 The present issue is about accessibility of slice arrays copy
 constructors which the Standard says are private.
 
 -- Gaby


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/3247
@ 2001-06-26 18:06 Benjamin Kosnik
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Kosnik @ 2001-06-26 18:06 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/3247; it has been noted by GNATS.

From: Benjamin Kosnik <bkoz@nabi.net>
To: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
Cc: <bkoz@gnu.org>, <gcc-gnats@gcc.gnu.org>, <gdr@codesourcery.com>
Subject: Re: libstdc++/3247 
Date: Tue, 26 Jun 2001 20:03:12 -0500 (CDT)

 > This is a known (IMHO mis-) "feature" of the slice or
 > gslice interface of the ISO standard. This is because the C++ standard
 > library does not specify that valarray subsets provide the same
 > operations as valarrays. Therefore, some ugly casts to the valarray
 > type are needed. Please confer page 554 of "The C++ Standard Library"
 > by Josuttis. For example, the following code does indeed compile. To get a
 > working program, you have to dimension the (val)arrays, though.
 
 Hmm. Thanks for the info. I think Gaby was trying to explain this to me
 before, but this is pretty clear.
 
 Gaby, if this stuff is indeed incorrect code, then the bug reports that
 I've filed on this can be closed.
 
 I suppose fixing the standard so that this stuff is "fixed" will
 eventually get done..
 
 thanks,
 benjamin
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/3247
@ 2001-06-26 17:56 Peter Schmid
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Schmid @ 2001-06-26 17:56 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/3247; it has been noted by GNATS.

From: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
To: bkoz@gnu.org
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/3247 
Date: Wed, 27 Jun 2001 03:55:23 +0200 (CEST)

 This is a known (IMHO mis-) "feature" of the slice or
 gslice interface of the ISO standard. This is because the C++ standard
 library does not specify that valarray subsets provide the same
 operations as valarrays. Therefore, some ugly casts to the valarray
 type are needed. Please confer page 554 of "The C++ Standard Library"
 by Josuttis. For example, the following code does indeed compile. To get a
 working program, you have to dimension the (val)arrays, though.
 
 Hope this helps,
 
 Peter Schmid
 
 Source code tbkoz.C
 #include <cstddef>
 #include <valarray>
 
 template <typename T1, typename Param1, class Param2> 
 void gnu_operator(T1, Param1 p1, Param2 p2)
 { std::operator*<T1>(p1, p2); }
 
 int main()
 {
     double dvar = 1.0;
     std::valarray<double> val_d;
     std::slice slc;
     std::gslice gslc;
     std::valarray<bool> val_b;
     std::valarray<std::size_t> val_sizet;
 
     gnu_operator(dvar, val_d, val_d);
     gnu_operator(dvar, val_d, static_cast<std::valarray<double> > (val_d[slc]));
     gnu_operator(dvar, val_d, static_cast<std::valarray<double> > (val_d[gslc]) ); 
     gnu_operator(dvar, val_d, static_cast<std::valarray<double> > (val_d[val_b]));
     gnu_operator(dvar, val_d, static_cast<std::valarray<double> > (val_d[val_sizet]));
 
         // and so on...
     gnu_operator(dvar, static_cast<std::valarray<double> > (val_d[slc]), static_cast<std::valarray<double> > (val_d[slc]));
 
     return 0;
 };
 
 Compiling tbkoz.C
 
 g++ -v tbkoz.C -W -Wall
 Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
 Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-languages=c,c++,f77,objc
 Thread model: posix
 gcc version 3.0 20010615 (prerelease)
  /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tbkoz.C -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase tbkoz.C -W -Wall -version -o /tmp/cc6nIa8N.s
 GNU CPP version 3.0 20010615 (prerelease) (cpplib) (i386 Linux/ELF)
 GNU C++ version 3.0 20010615 (prerelease) (i686-pc-linux-gnu)
 	compiled by GNU C version 3.0 20010615 (prerelease).
 ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/local/include/g++-v3
  /usr/local/include/g++-v3/i686-pc-linux-gnu
  /usr/local/include/g++-v3/backward
  /usr/local/include
  /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
  /usr/include
 End of search list.
  /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccNiYQFr.o /tmp/cc6nIa8N.s
 GNU assembler version 2.11.90.0.15 (i686-pc-linux-gnu) using BFD version 2.11.90.0.15
  /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../.. /tmp/ccNiYQFr.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/crtend.o /usr/lib/crtn.o
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-06-27  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-27  1:16 libstdc++/3247 Gabriel Dos Reis
  -- strict thread matches above, loose matches on Subject: below --
2001-06-26 18:06 libstdc++/3247 Benjamin Kosnik
2001-06-26 17:56 libstdc++/3247 Peter Schmid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).