Backport
iterator.hpp File Reference

This header provides definitions from the C++ header <iterator> More...

#include "detail/config.hpp"
#include "type_traits.hpp"
#include <iterator>
#include <cstddef>
#include <initializer_list>
+ Include dependency graph for iterator.hpp:

Go to the source code of this file.

Typedefs

template<typename T >
using bpstd::reverse_iterator = std::reverse_iterator< T >
 

Functions

template<typename Iterator >
constexpr reverse_iterator< Iterator > bpstd::make_reverse_iterator (Iterator i)
 Makes a reverse_iterator given an iterator i. More...
 
template<typename T , std::size_t N>
constexpr T * bpstd::data (T(&array)[N]) noexcept
 Gets a pointer to the start of an array. More...
 
template<typename E >
constexpr const E * bpstd::data (std::initializer_list< E > il) noexcept
 Gets a pointer to the start of an initializer list. More...
 
template<typename C >
constexpr auto bpstd::empty (const C &c) -> decltype(c.empty())
 Queries whether c is empty. More...
 
template<typename T , std::size_t N>
constexpr bool bpstd::empty (const T(&array)[N]) noexcept
 Queries whether the array is empty. More...
 
template<typename E >
constexpr bool bpstd::empty (std::initializer_list< E > il) noexcept
 Queries whether an initializer list is empty. More...
 
template<typename C >
constexpr auto bpstd::size (const C &c) -> decltype(c.size())
 Gets the size of a container. More...
 
template<typename T , std::size_t N>
constexpr std::size_t bpstd::size (const T(&array)[N]) noexcept
 Gets the size of an array. More...
 
template<typename C >
constexpr auto bpstd::ssize (const C &c) -> common_type_t< std::ptrdiff_t, make_signed_t< decltype(c.size())>>
 Gets the signed-size of a container. More...
 
template<typename T , std::ptrdiff_t N>
constexpr std::ptrdiff_t bpstd::ssize (const T(&array)[N]) noexcept
 Gets the signed size of an array. More...
 
template<typename C >
constexpr auto bpstd::data (C &c) -> decltype(c.data())
 Gets a pointer to the data from c. More...
 
template<typename C >
constexpr auto bpstd::data (const C &c) -> decltype(c.data())
 Gets a pointer to the data from c. More...
 
template<typename C >
constexpr auto bpstd::data (C &c) -> decltype(c.data())
 Gets a pointer to the data from c. More...
 
template<typename C >
constexpr auto bpstd::data (const C &c) -> decltype(c.data())
 Gets a pointer to the data from c. More...
 

Detailed Description

This header provides definitions from the C++ header <iterator>

Definition in file iterator.hpp.

Function Documentation

◆ data() [1/4]

template<typename C >
constexpr auto bpstd::data ( C &  c) -> decltype(c.data())
constexpr

Gets a pointer to the data from c.

Parameters
cthe container to get the data pointe rrom
Returns
a pointer to the data

◆ data() [2/4]

template<typename C >
constexpr auto bpstd::data ( const C &  c) -> decltype(c.data())
constexpr

Gets a pointer to the data from c.

Parameters
cthe container to get the data pointe rrom
Returns
a pointer to the data

◆ data() [3/4]

template<typename E >
constexpr const E* bpstd::data ( std::initializer_list< E >  il)
constexprnoexcept

Gets a pointer to the start of an initializer list.

Parameters
ilthe initializer list
Returns
a pointer to the start of the initializer list

◆ data() [4/4]

template<typename T , std::size_t N>
constexpr T* bpstd::data ( T(&)  array[N])
constexprnoexcept

Gets a pointer to the start of an array.

Parameters
arraythe array to get the pointer to
Returns
a pointer to the data

◆ empty() [1/3]

template<typename C >
constexpr auto bpstd::empty ( const C &  c) -> decltype(c.empty())
constexpr

Queries whether c is empty.

Parameters
cthe container to query
Returns
true if is empty

◆ empty() [2/3]

template<typename T , std::size_t N>
constexpr bool bpstd::empty ( const T(&)  array[N])
constexprnoexcept

Queries whether the array is empty.

Parameters
arraythe array to check
Returns
true if N is 0

◆ empty() [3/3]

template<typename E >
constexpr bool bpstd::empty ( std::initializer_list< E >  il)
constexprnoexcept

Queries whether an initializer list is empty.

Parameters
ilthe initializer list to check
Returns
true if il is empty

◆ make_reverse_iterator()

template<typename Iterator >
constexpr reverse_iterator<Iterator> bpstd::make_reverse_iterator ( Iterator  i)
constexpr

Makes a reverse_iterator given an iterator i.

This is a convenience function template that constructs a reverse_iterator for the given iterator i with the type deduced from the type of the argument.

Parameters
ithe iterator
Returns
the reverse_iterator

◆ size() [1/2]

template<typename C >
constexpr auto bpstd::size ( const C &  c) -> decltype(c.size())
constexpr

Gets the size of a container.

Parameters
cthe container to check
Returns
the container's size

◆ size() [2/2]

template<typename T , std::size_t N>
constexpr std::size_t bpstd::size ( const T(&)  array[N])
constexprnoexcept

Gets the size of an array.

Parameters
arraythe array to get the size from
Returns
the size of an array

◆ ssize() [1/2]

template<typename C >
constexpr auto bpstd::ssize ( const C &  c) -> common_type_t< std::ptrdiff_t, make_signed_t< decltype(c.size())>>
constexpr

Gets the signed-size of a container.

Parameters
cthe container to get the size from
Returns
the size of the container

◆ ssize() [2/2]

template<typename T , std::ptrdiff_t N>
constexpr std::ptrdiff_t bpstd::ssize ( const T(&)  array[N])
constexprnoexcept

Gets the signed size of an array.

Parameters
arraythe array to get the size from
Returns
the size of an array