Skip to content

Commit

Permalink
Update variantvisit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
MeouSker77 authored Jul 16, 2023
1 parent 87e0548 commit 31e86ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions latex/code/lib/variantvisit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct MyVisitor
std::cout << "string: " << s << '\n';
}
void operator() (long double d) const {
std::cotu << "double: " << d << '\n';
std::cout << "double: " << d << '\n';
}
};

Expand All @@ -23,4 +23,4 @@ int main()
std::visit(MyVisitor(), var); // 调用string的operator()
var = 42.7;
std::visit(MyVisitor(), var); // 调用long double的operator()
}
}

0 comments on commit 31e86ba

Please sign in to comment.