I am watching the talk Modern Template Metaprogramming by Walter E. Brown. At 54:40 a code is given as below
template<class T, T v>
struct integral_constant{
static constexpr T value = v;
constexpr operator T() const noexcept { return value; } // what does this mean?
constexpr T operator T() const noexcept { return value; }
};
My question is what does this line mean
constexpr operator T() const noexcept { return value; }
, why there is no return type but it is still returning value
? Is this a typo?
constexpr T operator ()() const noexcept { return value; }
, which is a function call operator. – Photocomposition