Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Template arguments may contain calls to constexpr functions.
// Template arguments may contain calls to constexpr functions. #include <bitset> #include <cstddef> #include <iostream> namespace { constexpr std::size_t factorial(std::size_t n) noexcept { std::size_t acc {1u}; for (; n > 1u; --n) acc *= n; return acc; } } int main() { std::bitset<factorial(7)> bits; bits.flip(); std::cout << bits.count() << '\n'; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
regex
selection sort
test string
return reference (clang)
11/18
program_4
bank queue
PrintAddress
Combination
std::99 bottles of beer!
Please log in to post a comment.