Re: Array size validity and SFINAE

Liste des GroupesRevenir à cl c++ 
Sujet : Re: Array size validity and SFINAE
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++
Date : 02. Mar 2026, 13:21:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <10o3vc1$14fgl$1@raubtier-asyl.eternal-september.org>
References : 1 2
User-Agent : Mozilla Thunderbird
Am 01.03.2026 um 16:55 schrieb Marcel Mueller:

You are taking an array by value. This might not be the intention and might take a slice. Since the array index is unsigned -1 is UB or in fact expand to UINT_MAX.
If you write
   template <typename T> void foo(int (&)[T::N])
gcc will also output ...
I am unsure whether the overload resolution should take place
before the other checks.
Or better a C++ span with a fixed size.With that you can have bouds-checking wile debugging.

Date Sujet#  Auteur
25 Feb 26 * Array size validity and SFINAE9Andrey Tarasevich
1 Mar 26 +* Re: Array size validity and SFINAE5Marcel Mueller
1 Mar 26 i+* Re: Array size validity and SFINAE3Andrey Tarasevich
2 Mar 26 ii`* Re: Array size validity and SFINAE2Chris M. Thomasson
2 Mar 26 ii `- Re: Array size validity and SFINAE1Andrey Tarasevich
2 Mar 26 i`- Re: Array size validity and SFINAE1Bonita Montero
2 Mar 26 `* Re: Array size validity and SFINAE3Tim Rentsch
2 Mar 26  `* Re: Array size validity and SFINAE2Andrey Tarasevich
3 Mar 26   `- Re: Array size validity and SFINAE1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal