//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{}
)

// HelpTermsOfServiceUpdateClassArray is adapter for slice of HelpTermsOfServiceUpdateClass.
type HelpTermsOfServiceUpdateClassArray []HelpTermsOfServiceUpdateClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsHelpTermsOfServiceUpdateEmpty returns copy with only HelpTermsOfServiceUpdateEmpty constructors.
func ( HelpTermsOfServiceUpdateClassArray) () ( HelpTermsOfServiceUpdateEmptyArray) {
	for ,  := range  {
		,  := .(*HelpTermsOfServiceUpdateEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsHelpTermsOfServiceUpdate returns copy with only HelpTermsOfServiceUpdate constructors.
func ( HelpTermsOfServiceUpdateClassArray) () ( HelpTermsOfServiceUpdateArray) {
	for ,  := range  {
		,  := .(*HelpTermsOfServiceUpdate)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

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

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

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

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

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

// HelpTermsOfServiceUpdateEmptyArray is adapter for slice of HelpTermsOfServiceUpdateEmpty.
type HelpTermsOfServiceUpdateEmptyArray []HelpTermsOfServiceUpdateEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// HelpTermsOfServiceUpdateArray is adapter for slice of HelpTermsOfServiceUpdate.
type HelpTermsOfServiceUpdateArray []HelpTermsOfServiceUpdate

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}