Skip to content
Snippets Groups Projects
Commit 0d29552c authored by Bensong Liu's avatar Bensong Liu
Browse files

add scan<json> like function

parent 83a09137
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,12 @@ namespace rlib {
template <typename... Args>
size_t printfln(std::ostream &os, const std::string &fmt, Args... args);
template <typename TargetType = std::string>
inline TargetType scan(std::istream &is = std::cin) {
TargetType target;
is >> target;
return target;
}
inline rlib::string scanln(std::istream &is = std::cin, char delimiter = '\n') noexcept {
std::string line;
std::getline(is, line, delimiter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment