Run Code
|
API
|
Code Wall
|
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
Dynamic call
Graphs Iteration2 Directed Graphs
wellformed number
GraphBase
std::99 bottles of beer!
C++ Standard Template Library
Fun with Pointers #2
sort
Throttle Example using a circular queue (Push all but 2 less than maxSize; then pop all but 2 of current size)
IsContainer