Created
January 24, 2020 12:43
-
-
Save amigo421/76d89a26a883c540c1f583a0c94bf240 to your computer and use it in GitHub Desktop.
fibonacci compile time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emplate<size_t N> | |
struct fibonacci : integral_constant<size_t, fibonacci<N-1>{} + fibonacci<N-2>{}> {}; | |
template<> struct fibonacci<1> : integral_constant<size_t,1> {}; | |
template<> struct fibonacci<0> : integral_constant<size_t,0> {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment