fixed errors

This commit is contained in:
2022-12-27 05:09:23 +00:00
parent 9e7cffdc32
commit 922c90afc1

View File

@@ -2,12 +2,14 @@
using namespace std; using namespace std;
template <typename T, template <typename T,
typename = std::enable_if_t<std::is_arithmetic<T>::value, T>> typename = enable_if<is_arithmetic<T>::value, T>>
class Foo { class Foo
{
T x, y; T x, y;
public: public:
Foo() { Foo()
{
cout << "x: "; cout << "x: ";
cin >> x; cin >> x;
cout << "y: "; cout << "y: ";
@@ -19,7 +21,8 @@ public:
T mx() { return (x > y ? x : y); }; T mx() { return (x > y ? x : y); };
}; };
int main() { int main()
{
Foo<float> bar; Foo<float> bar;
cout << bar.mx() << endl; cout << bar.mx() << endl;