Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ClippedLargest (0.13 sec)

  1. test/typeparam/list.go

    type _ListNum[T OrderedNum] struct {
    	next *_ListNum[T]
    	val  T
    }
    
    const Clip = 5
    
    // ClippedLargest returns the largest in the list of OrderNums, but a max of 5.
    // Test use of untyped constant in an expression with a generically-typed parameter
    func (l *_ListNum[T]) ClippedLargest() T {
    	var max T
    	for p := l; p != nil; p = p.next {
    		if p.val > max && p.val < Clip {
    			max = p.val
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Dec 03 17:08:51 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  2. test/typeparam/listimp.dir/a.go

    }
    
    // ListNum is a linked _List of ordered numeric values of type T.
    type ListNum[T OrderedNum] struct {
    	Next *ListNum[T]
    	Val  T
    }
    
    const Clip = 5
    
    // ClippedLargest returns the largest in the list of OrderNums, but a max of 5.
    func (l *ListNum[T]) ClippedLargest() T {
    	var max T
    	for p := l; p != nil; p = p.Next {
    		if p.Val > max && p.Val < Clip {
    			max = p.Val
    		}
    	}
    	return max
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Dec 03 17:08:51 UTC 2022
    - 1.1K bytes
    - Viewed (0)
Back to top