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

// InputReplyToClassArray is adapter for slice of InputReplyToClass.
type InputReplyToClassArray []InputReplyToClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputReplyToMessage returns copy with only InputReplyToMessage constructors.
func ( InputReplyToClassArray) () ( InputReplyToMessageArray) {
	for ,  := range  {
		,  := .(*InputReplyToMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputReplyToStory returns copy with only InputReplyToStory constructors.
func ( InputReplyToClassArray) () ( InputReplyToStoryArray) {
	for ,  := range  {
		,  := .(*InputReplyToStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputReplyToMessageArray is adapter for slice of InputReplyToMessage.
type InputReplyToMessageArray []InputReplyToMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputReplyToStoryArray is adapter for slice of InputReplyToStory.
type InputReplyToStoryArray []InputReplyToStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}