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

// StoriesAllStoriesClassArray is adapter for slice of StoriesAllStoriesClass.
type StoriesAllStoriesClassArray []StoriesAllStoriesClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsStoriesAllStoriesNotModified returns copy with only StoriesAllStoriesNotModified constructors.
func ( StoriesAllStoriesClassArray) () ( StoriesAllStoriesNotModifiedArray) {
	for ,  := range  {
		,  := .(*StoriesAllStoriesNotModified)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStoriesAllStories returns copy with only StoriesAllStories constructors.
func ( StoriesAllStoriesClassArray) () ( StoriesAllStoriesArray) {
	for ,  := range  {
		,  := .(*StoriesAllStories)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( StoriesAllStoriesClassArray) ( []*StoriesAllStories) []*StoriesAllStories {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( StoriesAllStoriesClassArray) () ( []*StoriesAllStories) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( StoriesAllStoriesClassArray) () ( *StoriesAllStories,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( StoriesAllStoriesClassArray) () ( *StoriesAllStories,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *StoriesAllStoriesClassArray) () ( *StoriesAllStories,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *StoriesAllStoriesClassArray) () ( *StoriesAllStories,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// StoriesAllStoriesNotModifiedArray is adapter for slice of StoriesAllStoriesNotModified.
type StoriesAllStoriesNotModifiedArray []StoriesAllStoriesNotModified

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StoriesAllStoriesArray is adapter for slice of StoriesAllStories.
type StoriesAllStoriesArray []StoriesAllStories

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}