A Discrete-Event Network Simulator
API
ns3::has_begin_end< T > Struct Template Reference

SFINAE compile time check if type T has begin() and end() methods. More...

#include "attribute-container-accessor-helper.h"

+ Collaboration diagram for ns3::has_begin_end< T >:

Static Public Member Functions

template<typename C >
static char(& f (...))[2]
 Compiled if type T does not have a begin() method. More...
 
template<typename C >
static char(& f (typename std::enable_if< std::is_same< decltype(static_cast< typename C::const_iterator(C::*)() const >(&C::begin)), typename C::const_iterator(C::*)() const >::value, void >::type *))[1]
 Compiled if type T has a begin() method. More...
 
template<typename C >
static char(& g (...))[2]
 Compiled if type T does not have an end() method. More...
 
template<typename C >
static char(& g (typename std::enable_if< std::is_same< decltype(static_cast< typename C::const_iterator(C::*)() const >(&C::end)), typename C::const_iterator(C::*)() const >::value, void >::type *))[1]
 Compiled if type T has an end() method. More...
 

Static Public Attributes

static bool const beg_value = sizeof (f<T> (0)) == 1
 True if type T has a begin() method. More...
 
static bool const end_value = sizeof (g<T> (0)) == 1
 True if type T has an end() method. More...
 

Detailed Description

template<typename T>
struct ns3::has_begin_end< T >

SFINAE compile time check if type T has begin() and end() methods.

Definition at line 71 of file attribute-container-accessor-helper.h.

Member Function Documentation

◆ f() [1/2]

template<typename T >
template<typename C >
static char(& ns3::has_begin_end< T >::f (   ...) )[2]
static

Compiled if type T does not have a begin() method.

Returns
A value indicating that this specialization has been compiled.

◆ f() [2/2]

template<typename T >
template<typename C >
static char(& ns3::has_begin_end< T >::f ( typename std::enable_if< std::is_same< decltype(static_cast< typename C::const_iterator(C::*)() const >(&C::begin)), typename C::const_iterator(C::*)() const >::value  ,
void  ,
::type *   
) )[1]
static

Compiled if type T has a begin() method.

Returns
A value indicating that this specialization has been compiled.

◆ g() [1/2]

template<typename T >
template<typename C >
static char(& ns3::has_begin_end< T >::g (   ...) )[2]
static

Compiled if type T does not have an end() method.

Returns
A value indicating that this specialization has been compiled.

Referenced by grid.Color::set().

+ Here is the caller graph for this function:

◆ g() [2/2]

template<typename T >
template<typename C >
static char(& ns3::has_begin_end< T >::g ( typename std::enable_if< std::is_same< decltype(static_cast< typename C::const_iterator(C::*)() const >(&C::end)), typename C::const_iterator(C::*)() const >::value  ,
void  ,
::type *   
) )[1]
static

Compiled if type T has an end() method.

Returns
A value indicating that this specialization has been compiled.

Referenced by grid.Color::set().

+ Here is the caller graph for this function:

Member Data Documentation

◆ beg_value

template<typename T >
bool const ns3::has_begin_end< T >::beg_value = sizeof (f<T> (0)) == 1
static

True if type T has a begin() method.

Definition at line 102 of file attribute-container-accessor-helper.h.

◆ end_value

template<typename T >
bool const ns3::has_begin_end< T >::end_value = sizeof (g<T> (0)) == 1
static

True if type T has an end() method.

Definition at line 104 of file attribute-container-accessor-helper.h.


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