fork(2) download
  1.  
  2.  
  3. #include <boost/date_time/posix_time/posix_time.hpp>
  4. #include <boost/date_time/gregorian/gregorian.hpp>
  5. #include <iostream>
  6. using namespace std;
  7. using boost::gregorian::date;
  8. using boost::posix_time::ptime;
  9.  
  10. date f(date d){
  11. return next_weekday(d, boost::date_time::weekdays::Friday);
  12. }
  13.  
  14. int main() {
  15. // your code goes here
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/boost/date_time/gregorian/gregorian_types.hpp:25:0,
                 from /usr/include/boost/date_time/posix_time/posix_time_config.hpp:18,
                 from /usr/include/boost/date_time/posix_time/posix_time_system.hpp:13,
                 from /usr/include/boost/date_time/posix_time/ptime.hpp:12,
                 from /usr/include/boost/date_time/posix_time/posix_time.hpp:15,
                 from prog.cpp:3:
/usr/include/boost/date_time/date_generators.hpp: In instantiation of 'typename date_type::duration_type boost::date_time::days_until_weekday(const date_type&, const weekday_type&) [with date_type = boost::gregorian::date; weekday_type = boost::date_time::weekdays; typename date_type::duration_type = boost::gregorian::date_duration]':
/usr/include/boost/date_time/date_generators.hpp:488:34:   required from 'date_type boost::date_time::next_weekday(const date_type&, const weekday_type&) [with date_type = boost::gregorian::date; weekday_type = boost::date_time::weekdays]'
prog.cpp:11:67:   required from here
/usr/include/boost/date_time/date_generators.hpp:452:37: error: request for member 'as_number' in 'wd', which is of non-class type 'const boost::date_time::weekdays'
     duration_type dd(wd.as_number() - d.day_of_week().as_number());
                                     ^
stdout
Standard output is empty