forked from HowardHinnant/date
Simplify the implementation of format and parse:
* For format, all a type must do is implement to_stream. * For parse, each type X must specialize parse_manip<X,CharT,Traits>. Each specialization must include a public typedef to itself named type. * Each parse_manip specialization must have a stream extraction operator. * This commit depends on expression-SFINAE. If this commit breaks your build, it is likely that your compiler/version does not support expression-SFINAE. To fix this NO_EXPRESSION_SFINAE needs to be defined in the configuration area of date.h for that compiler/version.
This commit is contained in:
@@ -390,6 +390,14 @@ test_F()
|
||||
assert(!in.bad());
|
||||
assert(tp == 2016_y/12/13);
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-13"};
|
||||
year_month_day tp;
|
||||
in >> parse("%F", tp);
|
||||
assert(!in.fail());
|
||||
assert(!in.bad());
|
||||
assert(tp == 2016_y/12/13);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user