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

// AccountWallPapersClassArray is adapter for slice of AccountWallPapersClass.
type AccountWallPapersClassArray []AccountWallPapersClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsAccountWallPapers returns copy with only AccountWallPapers constructors.
func ( AccountWallPapersClassArray) () ( AccountWallPapersArray) {
	for ,  := range  {
		,  := .(*AccountWallPapers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( AccountWallPapersClassArray) ( []*AccountWallPapers) []*AccountWallPapers {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( AccountWallPapersClassArray) () ( []*AccountWallPapers) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( AccountWallPapersClassArray) () ( *AccountWallPapers,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( AccountWallPapersClassArray) () ( *AccountWallPapers,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *AccountWallPapersClassArray) () ( *AccountWallPapers,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *AccountWallPapersClassArray) () ( *AccountWallPapers,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// AccountWallPapersArray is adapter for slice of AccountWallPapers.
type AccountWallPapersArray []AccountWallPapers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}