Diag-Client-Lib
Classes | Typedefs | Functions
core_type::details Namespace Reference

Classes

struct  is_span
 Primary template handles Span types that have no nested ::type member. More...
 
struct  is_span< Span< T, Extent > >
 Type trait to check if passed element is Span or not. More...
 
struct  is_std_array
 Primary template handles std::array types that have no nested ::type member. More...
 
struct  is_std_array< std::array< T, N > >
 Type trait to check if passed element is std::array or not. More...
 
struct  is_data_size_valid
 Primary template handles std::size, std::data that have no nested ::type member. More...
 
struct  is_data_size_valid< T, std::void_t< decltype(std::data(std::declval< T >())), decltype(std::size(std::declval< T >()))> >
 Type trait to check if std::data(cont) and std::size(cont) are both well-formed. More...
 
struct  is_container_type
 Check if the element type is not a specialization of Span, Container is not a specialization of Array, Container is not a specialization of std::array, std::is_array<Container>::value is false, std::data(cont) and std::size(cont) are both well-formed. More...
 
struct  is_container_element_type_convertible
 Checks if std::remove_pointer_t<decltype(std::data(arr))>(*)[] is convertible to T(*)[]. More...
 
struct  is_container_element_type_convertible< F, T, typename std::enable_if< std::is_convertible< std::remove_pointer_t< decltype(std::data(std::declval< F >()))>(*)[], T(*)[]>::value >::type >
 Checks if std::remove_pointer_t<decltype(std::data(arr))>(*)[] is convertible to T(*)[]. More...
 
struct  span_storage
 Storage class needed for span. More...
 
struct  span_storage< T, dynamic_extent >
 Storage class needed for span. More...
 

Typedefs

template<typename T >
using remove_cv_ref_t = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 Helper template alias to remove reference and cv and return the actual type. More...
 

Functions

void CheckIfExpectedOrAbort (bool cond, const char *message, const std::string_view file_name, int line_no)
 Check if the condition is as expected otherwise abort with provided message. More...
 

Typedef Documentation

◆ remove_cv_ref_t

template<typename T >
using core_type::details::remove_cv_ref_t = typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type

Helper template alias to remove reference and cv and return the actual type.

Template Parameters
TThe Element type

Definition at line 59 of file span.h.

Function Documentation

◆ CheckIfExpectedOrAbort()

void core_type::details::CheckIfExpectedOrAbort ( bool  cond,
const char *  message,
const std::string_view  file_name,
int  line_no 
)
inline

Check if the condition is as expected otherwise abort with provided message.

Parameters
[in]condThe condition to check
[in]messageThe message to output when violated

Definition at line 46 of file span.h.

46  {
47  if (!cond) {
48  std::cerr << message << " [" << file_name << ":" << line_no << "]" << std::endl;
49  std::abort();
50  }
51 }

Referenced by core_type::Span< T, Extent >::back(), core_type::Span< T, Extent >::first(), core_type::Span< T, Extent >::front(), core_type::Span< T, Extent >::last(), core_type::Span< T, Extent >::operator[](), core_type::Span< T, Extent >::Span(), and core_type::Span< T, Extent >::subspan().

Here is the caller graph for this function: