From 922c90afc19823d8b54ba2ff1edae61d4b911f15 Mon Sep 17 00:00:00 2001 From: eternal-will Date: Tue, 27 Dec 2022 05:09:23 +0000 Subject: [PATCH] fixed errors --- lab9/26.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lab9/26.cpp b/lab9/26.cpp index d3389e4..ab99a20 100644 --- a/lab9/26.cpp +++ b/lab9/26.cpp @@ -2,27 +2,30 @@ using namespace std; template ::value, T>> -class Foo { - T x, y; + typename = enable_if::value, T>> +class Foo +{ + T x, y; public: - Foo() { - cout << "x: "; - cin >> x; - cout << "y: "; - cin >> y; - } + Foo() + { + cout << "x: "; + cin >> x; + cout << "y: "; + cin >> y; + } - ~Foo() { cout << "Destructor called, nothing to do here."; } + ~Foo() { cout << "Destructor called, nothing to do here."; } - T mx() { return (x > y ? x : y); }; + T mx() { return (x > y ? x : y); }; }; -int main() { - Foo bar; +int main() +{ + Foo bar; - cout << bar.mx() << endl; + cout << bar.mx() << endl; - return 0; -} + return 0; +} \ No newline at end of file