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

// EmailVerifyPurposeClassArray is adapter for slice of EmailVerifyPurposeClass.
type EmailVerifyPurposeClassArray []EmailVerifyPurposeClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsEmailVerifyPurposeLoginSetup returns copy with only EmailVerifyPurposeLoginSetup constructors.
func ( EmailVerifyPurposeClassArray) () ( EmailVerifyPurposeLoginSetupArray) {
	for ,  := range  {
		,  := .(*EmailVerifyPurposeLoginSetup)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// EmailVerifyPurposeLoginSetupArray is adapter for slice of EmailVerifyPurposeLoginSetup.
type EmailVerifyPurposeLoginSetupArray []EmailVerifyPurposeLoginSetup

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}