Changeset 0210a543


Ignore:
Timestamp:
Dec 17, 2025, 12:59:50 PM (3 days ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
eb0d9b7
Parents:
5d300ba
Message:

Revise array's overload-selection comment now that #247 is closed.

The set of overloads required is unaffected, just there's a simpler derivation of this set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/array.hfa

    r5d300ba r0210a543  
    6969        //    types like size_t.  So trying to overload on ptrdiff_t vs int works in 64-bit mode
    7070        //    but not in 32-bit mode.
    71         // -  Given bug of Trac #247, CFA gives sizeof expressions type unsigned long int, when it
    72         //    should give them type size_t.
    73         //
    74         //                          gcc -m32         cfa -m32 given bug         gcc -m64 (and cfa)
    75         // ptrdiff_t                int              int                        long int
    76         // size_t                   unsigned int     unsigned int               unsigned long int
    77         // typeof( sizeof(42) )     unsigned int     unsigned long int          unsigned long int
    78         // int                      int              int                        int
     71        //
     72        //                          cfa -m32 (and gcc)      cfa -m64 (and gcc)
     73        // ptrdiff_t                int                     long int
     74        // size_t                   unsigned int            unsigned long int
     75        // typeof( sizeof(42) )     unsigned int            unsigned long int
     76        // int                      int                     int
    7977        //
    8078        // So the solution must support types {zero_t, one_t, int, unsigned int, long int, unsigned long int}
     
    8381        // because assertion satisfaction requires types to match exacly.  Both higher-dimensional
    8482        // subscripting and operations on slices use asserted subscript operators.  The test case
    85         // array-container/array-sbscr-cases covers the combinations.  Mike beleives that commenting out
     83        // array-collections/array-sbscr-types covers the combinations.  Mike beleives that commenting out
    8684        // any of the current overloads leads to one of those cases failing, either on 64- or 32-bit.
    8785        // Mike is open to being shown a smaller set of overloads that still passes the test.
     86
    8887
    8988        static inline Timmed & ?[?]( arpk( N, S, Timmed, Tbase ) & a, zero_t ) {
Note: See TracChangeset for help on using the changeset viewer.