6

I am doing this

 boost::gregorian::date current_date(boost::date_time::day_clock::local_day());

and I get the following error

‘template<class date_type> class boost::date_time::day_clock’ used without template parameters  

Anything that I have to do different ?

reference http://www.boost.org/doc/libs/1_47_0/doc/html/date_time/gregorian.html#date_construct_from_clock

HelloWorld_Always
  • 1,555
  • 3
  • 22
  • 32

1 Answers1

15

You're using the wrong day_clock – use this instead:

boost::gregorian::date current_date(boost::gregorian::day_clock::local_day());

day_clock in boost::date_time is a generic interface (template in this case) meant to be used with an externally supplied 'date' type, and you're not supplying that type. day_clock in boost::gregorian is a typedef of said interface using boost::gregorian::date as the supplied 'date' type.

ildjarn
  • 62,044
  • 9
  • 127
  • 211