//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// HelpUserInfoClassArray is adapter for slice of HelpUserInfoClass.
type HelpUserInfoClassArray []HelpUserInfoClass

// Sort sorts slice of HelpUserInfoClass.
func ( HelpUserInfoClassArray) ( func(,  HelpUserInfoClass) bool) HelpUserInfoClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of HelpUserInfoClass.
func ( HelpUserInfoClassArray) ( func(,  HelpUserInfoClass) bool) HelpUserInfoClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of HelpUserInfoClass.
func ( HelpUserInfoClassArray) ( func( HelpUserInfoClass) bool) HelpUserInfoClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( HelpUserInfoClassArray) () ( HelpUserInfoClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( HelpUserInfoClassArray) () ( HelpUserInfoClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *HelpUserInfoClassArray) () ( HelpUserInfoClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  HelpUserInfoClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *HelpUserInfoClassArray) () ( HelpUserInfoClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsHelpUserInfo returns copy with only HelpUserInfo constructors.
func ( HelpUserInfoClassArray) () ( HelpUserInfoArray) {
	for ,  := range  {
		,  := .(*HelpUserInfo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyNotEmpty appends only NotEmpty constructors to
// given slice.
func ( HelpUserInfoClassArray) ( []*HelpUserInfo) []*HelpUserInfo {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( HelpUserInfoClassArray) () ( []*HelpUserInfo) {
	return .AppendOnlyNotEmpty()
}

// FirstAsNotEmpty returns first element of slice (if exists).
func ( HelpUserInfoClassArray) () ( *HelpUserInfo,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// LastAsNotEmpty returns last element of slice (if exists).
func ( HelpUserInfoClassArray) () ( *HelpUserInfo,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopFirstAsNotEmpty returns element of slice (if exists).
func ( *HelpUserInfoClassArray) () ( *HelpUserInfo,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopAsNotEmpty returns element of slice (if exists).
func ( *HelpUserInfoClassArray) () ( *HelpUserInfo,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// HelpUserInfoArray is adapter for slice of HelpUserInfo.
type HelpUserInfoArray []HelpUserInfo

// Sort sorts slice of HelpUserInfo.
func ( HelpUserInfoArray) ( func(,  HelpUserInfo) bool) HelpUserInfoArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of HelpUserInfo.
func ( HelpUserInfoArray) ( func(,  HelpUserInfo) bool) HelpUserInfoArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of HelpUserInfo.
func ( HelpUserInfoArray) ( func( HelpUserInfo) bool) HelpUserInfoArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( HelpUserInfoArray) () ( HelpUserInfo,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( HelpUserInfoArray) () ( HelpUserInfo,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *HelpUserInfoArray) () ( HelpUserInfo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  HelpUserInfo
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *HelpUserInfoArray) () ( HelpUserInfo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// SortByDate sorts slice of HelpUserInfo by Date.
func ( HelpUserInfoArray) () HelpUserInfoArray {
	return .Sort(func(,  HelpUserInfo) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of HelpUserInfo by Date.
func ( HelpUserInfoArray) () HelpUserInfoArray {
	return .SortStable(func(,  HelpUserInfo) bool {
		return .GetDate() < .GetDate()
	})
}