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

// StatsGraphClassArray is adapter for slice of StatsGraphClass.
type StatsGraphClassArray []StatsGraphClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsStatsGraphAsync returns copy with only StatsGraphAsync constructors.
func ( StatsGraphClassArray) () ( StatsGraphAsyncArray) {
	for ,  := range  {
		,  := .(*StatsGraphAsync)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStatsGraphError returns copy with only StatsGraphError constructors.
func ( StatsGraphClassArray) () ( StatsGraphErrorArray) {
	for ,  := range  {
		,  := .(*StatsGraphError)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStatsGraph returns copy with only StatsGraph constructors.
func ( StatsGraphClassArray) () ( StatsGraphArray) {
	for ,  := range  {
		,  := .(*StatsGraph)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// StatsGraphAsyncArray is adapter for slice of StatsGraphAsync.
type StatsGraphAsyncArray []StatsGraphAsync

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StatsGraphErrorArray is adapter for slice of StatsGraphError.
type StatsGraphErrorArray []StatsGraphError

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StatsGraphArray is adapter for slice of StatsGraph.
type StatsGraphArray []StatsGraph

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}