https://mooseframework.inl.gov
Classes | Static Public Attributes | Private Types | Static Private Member Functions | List of all members
MooseUtils::Has_size< T > Class Template Reference

Taken from https://stackoverflow.com/a/257382 Evaluating constexpr (Has_size<T>::value) in a templated method over class T will return whether T is a standard container or a singleton. More...

#include <MooseUtils.h>

Classes

struct  No
 

Static Public Attributes

static constexpr bool value = sizeof(test<T>(0)) == sizeof(Yes)
 

Private Types

using Yes = char
 

Static Private Member Functions

template<typename C >
static Yes test (decltype(&C::size))
 
template<typename C >
static No test (...)
 

Detailed Description

template<typename T>
class MooseUtils::Has_size< T >

Taken from https://stackoverflow.com/a/257382 Evaluating constexpr (Has_size<T>::value) in a templated method over class T will return whether T is a standard container or a singleton.

Definition at line 666 of file MooseUtils.h.

Member Typedef Documentation

◆ Yes

template<typename T >
using MooseUtils::Has_size< T >::Yes = char
private

Definition at line 668 of file MooseUtils.h.

Member Function Documentation

◆ test() [1/2]

template<typename T >
template<typename C >
static Yes MooseUtils::Has_size< T >::test ( decltype &::size  )
staticprivate

◆ test() [2/2]

template<typename T >
template<typename C >
static No MooseUtils::Has_size< T >::test (   ...)
staticprivate

Member Data Documentation

◆ value

template<typename T >
constexpr bool MooseUtils::Has_size< T >::value = sizeof(test<T>(0)) == sizeof(Yes)
static

Definition at line 680 of file MooseUtils.h.


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