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

// PublicForwardClassArray is adapter for slice of PublicForwardClass.
type PublicForwardClassArray []PublicForwardClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsPublicForwardMessage returns copy with only PublicForwardMessage constructors.
func ( PublicForwardClassArray) () ( PublicForwardMessageArray) {
	for ,  := range  {
		,  := .(*PublicForwardMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPublicForwardStory returns copy with only PublicForwardStory constructors.
func ( PublicForwardClassArray) () ( PublicForwardStoryArray) {
	for ,  := range  {
		,  := .(*PublicForwardStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PublicForwardMessageArray is adapter for slice of PublicForwardMessage.
type PublicForwardMessageArray []PublicForwardMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PublicForwardStoryArray is adapter for slice of PublicForwardStory.
type PublicForwardStoryArray []PublicForwardStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}