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

// ChatlistsChatlistInviteClassArray is adapter for slice of ChatlistsChatlistInviteClass.
type ChatlistsChatlistInviteClassArray []ChatlistsChatlistInviteClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsChatlistsChatlistInviteAlready returns copy with only ChatlistsChatlistInviteAlready constructors.
func ( ChatlistsChatlistInviteClassArray) () ( ChatlistsChatlistInviteAlreadyArray) {
	for ,  := range  {
		,  := .(*ChatlistsChatlistInviteAlready)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChatlistsChatlistInvite returns copy with only ChatlistsChatlistInvite constructors.
func ( ChatlistsChatlistInviteClassArray) () ( ChatlistsChatlistInviteArray) {
	for ,  := range  {
		,  := .(*ChatlistsChatlistInvite)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ChatlistsChatlistInviteAlreadyArray is adapter for slice of ChatlistsChatlistInviteAlready.
type ChatlistsChatlistInviteAlreadyArray []ChatlistsChatlistInviteAlready

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// ChatlistsChatlistInviteArray is adapter for slice of ChatlistsChatlistInvite.
type ChatlistsChatlistInviteArray []ChatlistsChatlistInvite

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}