Skip to content

Instantly share code, notes, and snippets.

@oblitum
oblitum / compile-time-primes-2.cpp
Last active May 7, 2018 18:20
compile time primes
// compiled on Ubuntu 13.04 with:
// clang++ -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes-2.cpp -o compile-time-primes-2
// assembly output with:
// clang++ -S -mllvm --x86-asm-syntax=intel -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes-2.cpp -o compile-time-primes-2.asm
#include <array>
#include <iostream>
template<typename T>