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

// MessagesStickersClassArray is adapter for slice of MessagesStickersClass.
type MessagesStickersClassArray []MessagesStickersClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesStickers returns copy with only MessagesStickers constructors.
func ( MessagesStickersClassArray) () ( MessagesStickersArray) {
	for ,  := range  {
		,  := .(*MessagesStickers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

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

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

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

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

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

// MessagesStickersArray is adapter for slice of MessagesStickers.
type MessagesStickersArray []MessagesStickers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}