Speclib  0.1.2
The library for writing better CUDA libraries
sp::integral_constant< T, V > Struct Template Reference

Similar to std::integral_constant, but with the fun property that the type can be floating-point. More...

#include <integer_constant.hpp>

Public Types

using ValueType = T
 

Public Member Functions

constexpr operator T () const
 
constexpr auto operator() () const
 

Static Public Attributes

constexpr static T value = (T) V
 

Detailed Description

template<typename T, auto V>
struct sp::integral_constant< T, V >

Similar to std::integral_constant, but with the fun property that the type can be floating-point.

Although floating-point tparams are not allowed in C++17, there's no reason we can't allow an integral constant to logically be of floating point type (and implicitly convert to such). We just have to specify its value using an integer.