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

// InputUserClassArray is adapter for slice of InputUserClass.
type InputUserClassArray []InputUserClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputUser returns copy with only InputUser constructors.
func ( InputUserClassArray) () ( InputUserArray) {
	for ,  := range  {
		,  := .(*InputUser)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputUserFromMessage returns copy with only InputUserFromMessage constructors.
func ( InputUserClassArray) () ( InputUserFromMessageArray) {
	for ,  := range  {
		,  := .(*InputUserFromMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputUserArray is adapter for slice of InputUser.
type InputUserArray []InputUser

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputUserFromMessageArray is adapter for slice of InputUserFromMessage.
type InputUserFromMessageArray []InputUserFromMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}