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

// UserStatusClassArray is adapter for slice of UserStatusClass.
type UserStatusClassArray []UserStatusClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsUserStatusOnline returns copy with only UserStatusOnline constructors.
func ( UserStatusClassArray) () ( UserStatusOnlineArray) {
	for ,  := range  {
		,  := .(*UserStatusOnline)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUserStatusOffline returns copy with only UserStatusOffline constructors.
func ( UserStatusClassArray) () ( UserStatusOfflineArray) {
	for ,  := range  {
		,  := .(*UserStatusOffline)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// UserStatusOnlineArray is adapter for slice of UserStatusOnline.
type UserStatusOnlineArray []UserStatusOnline

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UserStatusOfflineArray is adapter for slice of UserStatusOffline.
type UserStatusOfflineArray []UserStatusOffline

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}