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

// AccountSavedRingtoneClassArray is adapter for slice of AccountSavedRingtoneClass.
type AccountSavedRingtoneClassArray []AccountSavedRingtoneClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsAccountSavedRingtoneConverted returns copy with only AccountSavedRingtoneConverted constructors.
func ( AccountSavedRingtoneClassArray) () ( AccountSavedRingtoneConvertedArray) {
	for ,  := range  {
		,  := .(*AccountSavedRingtoneConverted)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AccountSavedRingtoneConvertedArray is adapter for slice of AccountSavedRingtoneConverted.
type AccountSavedRingtoneConvertedArray []AccountSavedRingtoneConverted

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}