C++ Logo

STD-DISCUSSION

Advanced search

Subject: Making std::bitset constexpr
From: Henrik Sjöström (akilles77_at_[hidden])
Date: 2019-06-20 12:27:28


Is there a reason for most members of std::bitset not to be constexpr? For
example bitset.none(), all(), any(),count().

Currently this simple program fails to compile.

#include<bitset>

int main()

{

constexpr std::bitset<20> bits{};

constexpr auto is_none = bits.none(); //Fails as none() isn’t constexpr

}

Thanks in advance,
Henrik



STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups