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

// LangPackStringClassArray is adapter for slice of LangPackStringClass.
type LangPackStringClassArray []LangPackStringClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsLangPackString returns copy with only LangPackString constructors.
func ( LangPackStringClassArray) () ( LangPackStringArray) {
	for ,  := range  {
		,  := .(*LangPackString)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsLangPackStringPluralized returns copy with only LangPackStringPluralized constructors.
func ( LangPackStringClassArray) () ( LangPackStringPluralizedArray) {
	for ,  := range  {
		,  := .(*LangPackStringPluralized)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsLangPackStringDeleted returns copy with only LangPackStringDeleted constructors.
func ( LangPackStringClassArray) () ( LangPackStringDeletedArray) {
	for ,  := range  {
		,  := .(*LangPackStringDeleted)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// LangPackStringArray is adapter for slice of LangPackString.
type LangPackStringArray []LangPackString

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// LangPackStringPluralizedArray is adapter for slice of LangPackStringPluralized.
type LangPackStringPluralizedArray []LangPackStringPluralized

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// LangPackStringDeletedArray is adapter for slice of LangPackStringDeleted.
type LangPackStringDeletedArray []LangPackStringDeleted

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}