libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::BasicByteSpan< T > Class Template Reference

A minimal span-like non-owning view over contiguous bytes (C++17 has no std::span). More...

#include <types.hpp>

Public Types

using element_type = T
 

Public Member Functions

constexpr BasicByteSpan () noexcept=default
 
constexpr BasicByteSpan (T *data, std::size_t size) noexcept
 
template<class Byte , class = std::enable_if_t<sizeof(Byte) == 1 && std::is_const_v<T>>>
 BasicByteSpan (const Byte *data, std::size_t size) noexcept
 
template<class Byte , class = std::enable_if_t<sizeof(Byte) == 1 && !std::is_const_v<T>>>
 BasicByteSpan (Byte *data, std::size_t size) noexcept
 
constexpr T * data () const noexcept
 
constexpr std::size_t size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr T & operator[] (std::size_t i) const noexcept
 
constexpr T * begin () const noexcept
 
constexpr T * end () const noexcept
 
BasicByteSpan subspan (std::size_t offset, std::size_t count=static_cast< std::size_t >(-1)) const noexcept
 

Detailed Description

template<class T>
class sshpp::BasicByteSpan< T >

A minimal span-like non-owning view over contiguous bytes (C++17 has no std::span).

Member Typedef Documentation

◆ element_type

template<class T >
using sshpp::BasicByteSpan< T >::element_type = T

Constructor & Destructor Documentation

◆ BasicByteSpan() [1/4]

template<class T >
constexpr sshpp::BasicByteSpan< T >::BasicByteSpan ( )
constexprdefaultnoexcept

◆ BasicByteSpan() [2/4]

template<class T >
constexpr sshpp::BasicByteSpan< T >::BasicByteSpan ( T *  data,
std::size_t  size 
)
inlineconstexprnoexcept

◆ BasicByteSpan() [3/4]

template<class T >
template<class Byte , class = std::enable_if_t<sizeof(Byte) == 1 && std::is_const_v<T>>>
sshpp::BasicByteSpan< T >::BasicByteSpan ( const Byte *  data,
std::size_t  size 
)
inlinenoexcept

◆ BasicByteSpan() [4/4]

template<class T >
template<class Byte , class = std::enable_if_t<sizeof(Byte) == 1 && !std::is_const_v<T>>>
sshpp::BasicByteSpan< T >::BasicByteSpan ( Byte *  data,
std::size_t  size 
)
inlinenoexcept

Member Function Documentation

◆ data()

template<class T >
constexpr T * sshpp::BasicByteSpan< T >::data ( ) const
inlineconstexprnoexcept

◆ size()

template<class T >
constexpr std::size_t sshpp::BasicByteSpan< T >::size ( ) const
inlineconstexprnoexcept

◆ empty()

template<class T >
constexpr bool sshpp::BasicByteSpan< T >::empty ( ) const
inlineconstexprnoexcept

◆ operator[]()

template<class T >
constexpr T & sshpp::BasicByteSpan< T >::operator[] ( std::size_t  i) const
inlineconstexprnoexcept

◆ begin()

template<class T >
constexpr T * sshpp::BasicByteSpan< T >::begin ( ) const
inlineconstexprnoexcept

◆ end()

template<class T >
constexpr T * sshpp::BasicByteSpan< T >::end ( ) const
inlineconstexprnoexcept

◆ subspan()

template<class T >
BasicByteSpan sshpp::BasicByteSpan< T >::subspan ( std::size_t  offset,
std::size_t  count = static_cast<std::size_t>(-1) 
) const
inlinenoexcept

The documentation for this class was generated from the following file: