Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
pack expansion
//clang 3.7.0 #include <iostream> #include <utility> template <typename T> int newLine(T) { std::wcout << std::endl; return 0; } template <size_t... Pack> void expandPack(std::index_sequence<Pack...>) { int dummy[sizeof...(Pack)] = { newLine(Pack)... }; } template <size_t N> void generateNewLines() { return expandPack(std::make_index_sequence<N>{}); } int main() { std::cout << "Hello, world!"; generateNewLines<5>(); std::cout << "Hello, world!"; }
run
|
edit
|
history
|
help
0
Throttle Example using circular queue (push all but 2 less than maxSize; then pop all but 2 less than current size)
cv5_class
constructor-is-not-called-in-this-aggregation-class
test
K combinator - Lazy evaluation
overloading
numeric_limits
Struct memory ordering
First test
STL stack