Public Member Functions | Public Attributes | List of all members
clang::insights::is< T > Struct Template Reference

Handy helper to avoid longish comparisons. More...

#include "InsightsHelpers.h"

Collaboration diagram for clang::insights::is< T >:
Collaboration graph
[legend]

Public Member Functions

constexpr bool any_of (const auto &... ts) const
 

Public Attributes

t
 

Detailed Description

template<typename T>
struct clang::insights::is< T >

Handy helper to avoid longish comparisons.

The idea is taken from a talk from Björn Fahller at NDC TechTown 2019: Modern Techniques for Keeping Your Code DRY (https://youtu.be/YUWuNpxZa5k)

if( is{v}.any_of(A, B, C) ) { ... }
is(T) -> is< T >

Definition at line 342 of file InsightsHelpers.h.

Member Function Documentation

◆ any_of()

template<typename T >
constexpr bool clang::insights::is< T >::any_of ( const auto &...  ts) const
inlineconstexpr

Member Data Documentation

◆ t

template<typename T >
T clang::insights::is< T >::t

Definition at line 344 of file InsightsHelpers.h.

Referenced by clang::insights::is< T >::any_of().


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