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

// MessageReplyHeaderClassArray is adapter for slice of MessageReplyHeaderClass.
type MessageReplyHeaderClassArray []MessageReplyHeaderClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessageReplyHeader returns copy with only MessageReplyHeader constructors.
func ( MessageReplyHeaderClassArray) () ( MessageReplyHeaderArray) {
	for ,  := range  {
		,  := .(*MessageReplyHeader)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageReplyStoryHeader returns copy with only MessageReplyStoryHeader constructors.
func ( MessageReplyHeaderClassArray) () ( MessageReplyStoryHeaderArray) {
	for ,  := range  {
		,  := .(*MessageReplyStoryHeader)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MessageReplyHeaderArray is adapter for slice of MessageReplyHeader.
type MessageReplyHeaderArray []MessageReplyHeader

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageReplyStoryHeaderArray is adapter for slice of MessageReplyStoryHeader.
type MessageReplyStoryHeaderArray []MessageReplyStoryHeader

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}