From bb389f5b00d274f554c4c9398095c2fb3a70e664 Mon Sep 17 00:00:00 2001 From: Sandipan Mohanty <s.mohanty@fz-juelich.de> Date: Thu, 11 May 2023 22:56:31 +0200 Subject: [PATCH] Formatting changes in gcd_w_concepts --- day3/examples/gcd_w_concepts.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/day3/examples/gcd_w_concepts.cc b/day3/examples/gcd_w_concepts.cc index fc73967..71bcb5c 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"; } - -- GitLab