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

// MessagesStickerSetInstallResultClassArray is adapter for slice of MessagesStickerSetInstallResultClass.
type MessagesStickerSetInstallResultClassArray []MessagesStickerSetInstallResultClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesStickerSetInstallResultArchive returns copy with only MessagesStickerSetInstallResultArchive constructors.
func ( MessagesStickerSetInstallResultClassArray) () ( MessagesStickerSetInstallResultArchiveArray) {
	for ,  := range  {
		,  := .(*MessagesStickerSetInstallResultArchive)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MessagesStickerSetInstallResultArchiveArray is adapter for slice of MessagesStickerSetInstallResultArchive.
type MessagesStickerSetInstallResultArchiveArray []MessagesStickerSetInstallResultArchive

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}