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

// UpdatesChannelDifferenceClassArray is adapter for slice of UpdatesChannelDifferenceClass.
type UpdatesChannelDifferenceClassArray []UpdatesChannelDifferenceClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsUpdatesChannelDifferenceEmpty returns copy with only UpdatesChannelDifferenceEmpty constructors.
func ( UpdatesChannelDifferenceClassArray) () ( UpdatesChannelDifferenceEmptyArray) {
	for ,  := range  {
		,  := .(*UpdatesChannelDifferenceEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUpdatesChannelDifferenceTooLong returns copy with only UpdatesChannelDifferenceTooLong constructors.
func ( UpdatesChannelDifferenceClassArray) () ( UpdatesChannelDifferenceTooLongArray) {
	for ,  := range  {
		,  := .(*UpdatesChannelDifferenceTooLong)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUpdatesChannelDifference returns copy with only UpdatesChannelDifference constructors.
func ( UpdatesChannelDifferenceClassArray) () ( UpdatesChannelDifferenceArray) {
	for ,  := range  {
		,  := .(*UpdatesChannelDifference)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyNotEmpty appends only NotEmpty constructors to
// given slice.
func ( UpdatesChannelDifferenceClassArray) ( []NotEmptyUpdatesChannelDifference) []NotEmptyUpdatesChannelDifference {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( UpdatesChannelDifferenceClassArray) () ( []NotEmptyUpdatesChannelDifference) {
	return .AppendOnlyNotEmpty()
}

// FirstAsNotEmpty returns first element of slice (if exists).
func ( UpdatesChannelDifferenceClassArray) () ( NotEmptyUpdatesChannelDifference,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// LastAsNotEmpty returns last element of slice (if exists).
func ( UpdatesChannelDifferenceClassArray) () ( NotEmptyUpdatesChannelDifference,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopFirstAsNotEmpty returns element of slice (if exists).
func ( *UpdatesChannelDifferenceClassArray) () ( NotEmptyUpdatesChannelDifference,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopAsNotEmpty returns element of slice (if exists).
func ( *UpdatesChannelDifferenceClassArray) () ( NotEmptyUpdatesChannelDifference,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// UpdatesChannelDifferenceEmptyArray is adapter for slice of UpdatesChannelDifferenceEmpty.
type UpdatesChannelDifferenceEmptyArray []UpdatesChannelDifferenceEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UpdatesChannelDifferenceTooLongArray is adapter for slice of UpdatesChannelDifferenceTooLong.
type UpdatesChannelDifferenceTooLongArray []UpdatesChannelDifferenceTooLong

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UpdatesChannelDifferenceArray is adapter for slice of UpdatesChannelDifference.
type UpdatesChannelDifferenceArray []UpdatesChannelDifference

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}