Re: "span"

Liste des GroupesRevenir à l c 
Sujet : Re: "span"
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.c
Date : 23. Mar 2024, 21:32:06
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <utnanu$2r0de$1@i2pn2.org>
References : 1
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Stefan Ram wrote:
   Some people suggested to introduce a feature "span" (probably a
   type) into C++, so that when one has an int array "a" and calls
   "f( a )", the length of a is being transferred to "f", which "f"
   is defined using "void f(span<int> a)". The "span" in "f" then
   knows the length of "a". This is supposed to be less error prone
   than passing a pointer with a separate length argument.
>
i wrote on such thing for years here - i name it "full array"
i mean
int a[20] is "full array" when a is a structure of int* to begoning and int* to end or length  (there are natural two wersions and i tried both
though the one with pointer+_size is maybe more handy)
this foo(a) will pass this structure if a is full array - but this is to be done on language and compiler level
what c got
int a[20] //when a is only int*
i name half-array

Date Sujet#  Auteur
22 Mar 24 * "span"13Stefan Ram
22 Mar 24 +* Re: "span"8Thiago Adams
23 Mar 24 i`* Re: "span"7Ben Bacarisse
23 Mar 24 i `* Re: "span"6Thiago Adams
23 Mar 24 i  `* Re: "span"5Keith Thompson
24 Mar 24 i   `* Re: "span"4Ben Bacarisse
24 Mar 24 i    `* Re: "span"3Keith Thompson
24 Mar 24 i     +- Re: "span"1Ben Bacarisse
25 Mar 24 i     `- Re: "span"1Lawrence D'Oliveiro
23 Mar 24 +* Re: "span"2Ben Bacarisse
23 Mar 24 i`- Re: "span"1Kaz Kylheku
23 Mar 24 +- Re: "span"1fir
23 Mar 24 `- Re: "span"1Blue-Maned_Hawk

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal