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

// AccountEmojiStatusesClassArray is adapter for slice of AccountEmojiStatusesClass.
type AccountEmojiStatusesClassArray []AccountEmojiStatusesClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsAccountEmojiStatuses returns copy with only AccountEmojiStatuses constructors.
func ( AccountEmojiStatusesClassArray) () ( AccountEmojiStatusesArray) {
	for ,  := range  {
		,  := .(*AccountEmojiStatuses)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

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

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

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

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

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

// AccountEmojiStatusesArray is adapter for slice of AccountEmojiStatuses.
type AccountEmojiStatusesArray []AccountEmojiStatuses

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}