例:文字列から日付/時刻を解析して、日付/時刻のコンポーネントを分解したいと思っています。コードはハワードの小数点以下の桁数を取得する方法
std::wistringstream in{ L"2016-12-11 15:43:22.0999919" };
date::sys_time<std::chrono::microseconds> tp;
in >> date::parse(L"%F %T", tp);
assert(!in.fail());
assert(!in.bad());
date::sys_days dp = date::floor<date::days>(tp);
date::year_month_day the_date = date::year_month_day{ dp };
date::time_of_day<std::chrono::microseconds> the_time = date::make_time(tp - dp);
std::cout << the_date << ' ' << the_time << std::endl;
std::cout << "Year: " << the_date.year() << std::endl;
std::cout << "Month: " << (unsigned)the_date.month() << std::endl;
std::cout << "Date: " << the_date.day() << std::endl;
std::cout << "Hour: " << the_time.hours().count() << std::endl;
std::cout << "Minutes: " << the_time.minutes().count() << std::endl;
std::cout << "Seconds: " << the_time.seconds().count() << std::endl;
//の後に、次の正しくない
std::cout << "Micro Seconds: " << the_time.microseconds().count() << std::endl;
エラーC2039: 'マイクロ秒':のメンバーではない '日:: TIME_OF_DAY'
何が間違っていますか? – Swift
'microseconds()'は 'date :: time_of_day'のメンバーではありません –