C++ Logo

std-proposals

Advanced search

[std-proposals] concepts in <complex>

From: Abdullah Qasim <iamminecraftredstoner_at_[hidden]>
Date: Wed, 4 May 2022 07:10:29 +0000
Right now, complex class is pretty WIERD:

complex<char> c(‘1’, ‘2’);

LOL.
Why not implement a concept in <complex.h>: (in anonymous namespace)

template <typename T>
concept C = std::_Is_nonbool_integral<T>() || std::is_floating_point_v<T>();

BETTER: define this concept as std::number in <stdlib.h>

(And equivalent concepts in other classes)



Received on 2022-05-04 07:10:31