Krita Source Code Documentation
Loading...
Searching...
No Matches
KritaUtils::is_container< T > Struct Template Reference

#include <krita_container_utils.h>

Public Types

typedef std::remove_const< T >::type test_type
 

Static Public Member Functions

template<typename A >
static constexpr bool test (...)
 
template<typename A >
static constexpr bool test (A *pointer, A const *const_pointer=nullptr, decltype(pointer->begin()) *=nullptr, decltype(pointer->end()) *=nullptr, decltype(const_pointer->begin()) *=nullptr, decltype(const_pointer->end()) *=nullptr, typename A::iterator *it=nullptr, typename A::const_iterator *constIt=nullptr, typename A::value_type *=nullptr)
 

Static Public Attributes

static const bool value = test<test_type>(nullptr)
 

Detailed Description

template<typename T>
struct KritaUtils::is_container< T >

Definition at line 49 of file krita_container_utils.h.

Member Typedef Documentation

◆ test_type

template<typename T >
typedef std::remove_const<T>::type KritaUtils::is_container< T >::test_type

Definition at line 51 of file krita_container_utils.h.

Member Function Documentation

◆ test() [1/2]

template<typename T >
template<typename A >
static constexpr bool KritaUtils::is_container< T >::test ( ...)
inlinestaticconstexpr

Definition at line 78 of file krita_container_utils.h.

78 {
79 return false;
80 }

◆ test() [2/2]

template<typename T >
template<typename A >
static constexpr bool KritaUtils::is_container< T >::test ( A * pointer,
A const * const_pointer = nullptr,
decltype(pointer->begin()) * = nullptr,
decltype(pointer->end()) * = nullptr,
decltype(const_pointer->begin()) * = nullptr,
decltype(const_pointer->end()) * = nullptr,
typename A::iterator * it = nullptr,
typename A::const_iterator * constIt = nullptr,
typename A::value_type * = nullptr )
inlinestaticconstexpr

Definition at line 54 of file krita_container_utils.h.

63 {
64
65 typedef typename A::iterator iterator;
66 typedef typename A::const_iterator const_iterator;
67 typedef typename A::value_type value_type;
68 return std::is_same<decltype(pointer->begin()),iterator>::value &&
69 std::is_same<decltype(pointer->end()),iterator>::value &&
70 std::is_same<decltype(const_pointer->begin()),const_iterator>::value &&
71 std::is_same<decltype(const_pointer->end()),const_iterator>::value &&
72 std::is_same<decltype(**it),value_type &>::value &&
73 std::is_same<decltype(**constIt),value_type const &>::value;
74
75 }

References KritaUtils::is_container< T >::value.

Member Data Documentation

◆ value

template<typename T >
const bool KritaUtils::is_container< T >::value = test<test_type>(nullptr)
static

Definition at line 82 of file krita_container_utils.h.


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