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

// InputGeoPointClassArray is adapter for slice of InputGeoPointClass.
type InputGeoPointClassArray []InputGeoPointClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputGeoPoint returns copy with only InputGeoPoint constructors.
func ( InputGeoPointClassArray) () ( InputGeoPointArray) {
	for ,  := range  {
		,  := .(*InputGeoPoint)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyNotEmpty appends only NotEmpty constructors to
// given slice.
func ( InputGeoPointClassArray) ( []*InputGeoPoint) []*InputGeoPoint {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( InputGeoPointClassArray) () ( []*InputGeoPoint) {
	return .AppendOnlyNotEmpty()
}

// FirstAsNotEmpty returns first element of slice (if exists).
func ( InputGeoPointClassArray) () ( *InputGeoPoint,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// LastAsNotEmpty returns last element of slice (if exists).
func ( InputGeoPointClassArray) () ( *InputGeoPoint,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopFirstAsNotEmpty returns element of slice (if exists).
func ( *InputGeoPointClassArray) () ( *InputGeoPoint,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopAsNotEmpty returns element of slice (if exists).
func ( *InputGeoPointClassArray) () ( *InputGeoPoint,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// InputGeoPointArray is adapter for slice of InputGeoPoint.
type InputGeoPointArray []InputGeoPoint

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}