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

// HelpCountriesListClassArray is adapter for slice of HelpCountriesListClass.
type HelpCountriesListClassArray []HelpCountriesListClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsHelpCountriesList returns copy with only HelpCountriesList constructors.
func ( HelpCountriesListClassArray) () ( HelpCountriesListArray) {
	for ,  := range  {
		,  := .(*HelpCountriesList)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( HelpCountriesListClassArray) ( []*HelpCountriesList) []*HelpCountriesList {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( HelpCountriesListClassArray) () ( []*HelpCountriesList) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( HelpCountriesListClassArray) () ( *HelpCountriesList,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( HelpCountriesListClassArray) () ( *HelpCountriesList,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *HelpCountriesListClassArray) () ( *HelpCountriesList,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *HelpCountriesListClassArray) () ( *HelpCountriesList,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// HelpCountriesListArray is adapter for slice of HelpCountriesList.
type HelpCountriesListArray []HelpCountriesList

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}