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

// MessagesExportedChatInviteClassArray is adapter for slice of MessagesExportedChatInviteClass.
type MessagesExportedChatInviteClassArray []MessagesExportedChatInviteClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesExportedChatInvite returns copy with only MessagesExportedChatInvite constructors.
func ( MessagesExportedChatInviteClassArray) () ( MessagesExportedChatInviteArray) {
	for ,  := range  {
		,  := .(*MessagesExportedChatInvite)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesExportedChatInviteReplaced returns copy with only MessagesExportedChatInviteReplaced constructors.
func ( MessagesExportedChatInviteClassArray) () ( MessagesExportedChatInviteReplacedArray) {
	for ,  := range  {
		,  := .(*MessagesExportedChatInviteReplaced)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MessagesExportedChatInviteArray is adapter for slice of MessagesExportedChatInvite.
type MessagesExportedChatInviteArray []MessagesExportedChatInvite

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesExportedChatInviteReplacedArray is adapter for slice of MessagesExportedChatInviteReplaced.
type MessagesExportedChatInviteReplacedArray []MessagesExportedChatInviteReplaced

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}