diff --git a/day3/examples/gcd_w_concepts.cc b/day3/examples/gcd_w_concepts.cc index fc739673145381c813c1dca8b703dc25122c7a27..71bcb5cf3a2b26335ad9053496acfae8ae3692dc 100644 --- a/day3/examples/gcd_w_concepts.cc +++ b/day3/examples/gcd_w_concepts.cc @@ -1,17 +1,18 @@ -#include <type_traits> #include <iostream> +#include <type_traits> template <class T> concept Integral = std::is_integral_v<T>; -constexpr auto gcd(Integral auto a, Integral auto b) { - if (b == 0) return a; - else return gcd(b, a % b); +constexpr auto gcd(Integral auto a, Integral auto b) +{ + if (b == 0) + return a; + return gcd(b, a % b); } auto main() -> int -{ +{ // Wont compile, until both the following arguments // are changed into integral types. std::cout << gcd(149935, 47295.) << "\n"; } -