carl  24.02
Computer ARithmetic Library
carl::has_subtype< T > Struct Template Reference

This template is designed to provide types that are related to other types. More...

#include <typetraits.h>

Inheritance diagram for carl::has_subtype< T >:

Public Types

using type = T
 A type associated with the type. More...
 

Detailed Description

template<typename T>
struct carl::has_subtype< T >

This template is designed to provide types that are related to other types.

It works very much like std::integral_constant, except that it provides a type instead of a constant. We use it as an extension to type traits, meaning that types may have traits that are boolean or other types.

The class can be used as follows. Assume that you have a class A with an associated type B.

template<T> struct Associated {};
template<> struct Associated<A>: has_subtype<B> {};

Now you can obtain the associated type with Associated<A>::type.

Definition at line 75 of file typetraits.h.

Member Typedef Documentation

◆ type

template<typename T >
using carl::has_subtype< T >::type = T

A type associated with the type.

Definition at line 77 of file typetraits.h.


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