MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
slice.hpp File Reference
#include "../core.hpp"
#include "../traits.hpp"
#include "iter.hpp"
#include "optional.hpp"
#include <string>
#include <vector>
Include dependency graph for colls/slice.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mtcore::Slice< T >
 A Slice which is just a pointer + length Accessing elements through the array operator will do bounds checks Accessing out of bounds will terminate the program instead of throw Can also get sub slices. More...
 

Namespaces

namespace  mtcore
 Core library for C++ with Zig-related functionality.
 

Macros

#define MTCORE_SLICE_HPP
 

Functions

constexpr Slice< char32_t > mtcore::mut_slice_from (char32_t *cstr, size_t len)
 Creates a mutable slice from a utf32 string and length.
 
constexpr Slice< char32_t > mtcore::mut_slice_from (char32_t *cstr)
 Creates a mutable slice from a utf32 string in the form of a c string.
 
constexpr Slice< const char32_t > mtcore::slice_from (char32_t *cstr)
 Creates a slice from a utf32 string in the form of a c string.
 
constexpr Slice< const char32_t > mtcore::slice_from (char32_t *cstr, size_t len)
 Creates a slice from a utf32 string and length.
 
constexpr Slice< const char32_t > mtcore::slice_from (const char32_t *cstr, size_t len)
 Creates a slice from a utf32 string and length.
 
constexpr Slice< const char32_t > mtcore::slice_from (const char32_t *cstr)
 Creates a slice from a utf32 string in the form of a c string.
 
constexpr Slice< char16_t > mtcore::mut_slice_from (char16_t *cstr, size_t len)
 Creates a mutable slice from a utf16 string and length.
 
constexpr Slice< const char16_t > mtcore::slice_from (char16_t *cstr, size_t len)
 Creates a slice from a utf16 string and length.
 
constexpr Slice< const char16_t > mtcore::slice_from (const char16_t *cstr, size_t len)
 Creates a slice from a utf16 string and length.
 
constexpr Slice< char8_t > mtcore::mut_slice_from (char8_t *cstr, size_t len)
 Creates a mutable slice from a utf8 string and length.
 
constexpr Slice< const char8_t > mtcore::slice_from (char8_t *cstr, size_t len)
 Creates a slice from a utf8 string and length.
 
constexpr Slice< const char8_t > mtcore::slice_from (const char8_t *cstr, size_t len)
 Creates a slice from a utf8 string and length.
 
constexpr Slice< char16_t > mtcore::mut_slice_from (char16_t *cstr)
 Creates a mutable slice from a utf16 string in the form of a c string.
 
constexpr Slice< const char16_t > mtcore::slice_from (char16_t *cstr)
 Creates a slice from a utf16 string in the form of a c string.
 
constexpr Slice< const char16_t > mtcore::slice_from (const char16_t *cstr)
 Creates a slice from a utf16 string in the form of a c string.
 
constexpr Slice< char8_t > mtcore::mut_slice_from (char8_t *cstr)
 Creates a mutable slice from a utf8 string in the form of a c string.
 
constexpr Slice< const char8_t > mtcore::slice_from (char8_t *cstr)
 Creates a slice from a utf8 string in the form of a c string.
 
constexpr Slice< const char8_t > mtcore::slice_from (const char8_t *cstr)
 Creates a slice from a utf8 string in the form of a c string.
 
constexpr Slice< const char > mtcore::slice_from (char *cstr)
 Creates a slice from a string in the form of a c string.
 
constexpr Slice< const char > mtcore::slice_from (const char *cstr)
 Creates a slice from a string in the form of a c string.
 
constexpr Slice< const char > mtcore::slice_from (char *cstr, const size_t len)
 Creates a slice from a string with a length.
 
constexpr Slice< char > mtcore::mut_slice_from (char *cstr, const size_t len)
 Creates a mutable slice from a string with a length.
 
constexpr Slice< const char > mtcore::slice_from (const char *cstr, const size_t len)
 Creates a slice from a string with a length.
 
Slice< const char > mtcore::slice_from (const std::string &str)
 Creates a slice from a std::string.
 
constexpr Slice< const char > mtcore::slice_from (const std::string_view &sv)
 Creates a slice from a std::string_view.
 
template<typename T>
Slice< std::add_const_t< T > > mtcore::slice_from (const std::vector< T > &arr)
 Creates a slice from a vector.
 
template<typename T>
Slice< T > mtcore::mut_slice_from (std::vector< T > &arr)
 Creates a mutable slice from a vector.
 
template<typename T, size_t N>
constexpr Slice< std::add_const_t< T > > mtcore::slice_from (const std::array< T, N > &arr)
 Creates a slice from an array.
 
template<typename T, size_t N>
constexpr Slice< T > mtcore::mut_slice_from (std::array< T, N > &arr)
 Creates a mutable slice from an array.
 
Slice< char > mtcore::mut_slice_from (char *cstr)
 Creates a mutable slice from a c string.
 
Slice< char > mtcore::mut_slice_from (std::string &str)
 Creates a mutable slice from a string.
 
template<typename Left, typename Right>
std::strong_ordering mtcore::str_compare (const Left &left, const Right &right)
 Compares two string strings for ordering.
 
template<typename L, typename R>
bool mtcore::str_equal (const L &left, const R &right)
 Compares two string strings for ordering.
 

Macro Definition Documentation

◆ MTCORE_SLICE_HPP

#define MTCORE_SLICE_HPP

Definition at line 22 of file colls/slice.hpp.