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

// PhotosPhotosClassArray is adapter for slice of PhotosPhotosClass.
type PhotosPhotosClassArray []PhotosPhotosClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsPhotosPhotos returns copy with only PhotosPhotos constructors.
func ( PhotosPhotosClassArray) () ( PhotosPhotosArray) {
	for ,  := range  {
		,  := .(*PhotosPhotos)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPhotosPhotosSlice returns copy with only PhotosPhotosSlice constructors.
func ( PhotosPhotosClassArray) () ( PhotosPhotosSliceArray) {
	for ,  := range  {
		,  := .(*PhotosPhotosSlice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PhotosPhotosArray is adapter for slice of PhotosPhotos.
type PhotosPhotosArray []PhotosPhotos

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PhotosPhotosSliceArray is adapter for slice of PhotosPhotosSlice.
type PhotosPhotosSliceArray []PhotosPhotosSlice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}