year_month_day.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef YearMonthDayBase_HPP__
  2. #define YearMonthDayBase_HPP__
  3. /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
  4. * Use, modification and distribution is subject to the
  5. * Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  7. * Author: Jeff Garland
  8. * $Date$
  9. */
  10. #include <boost/date_time/compiler_config.hpp>
  11. namespace boost {
  12. namespace date_time {
  13. //! Allow rapid creation of ymd triples of different types
  14. template<typename YearType, typename MonthType, typename DayType>
  15. struct BOOST_SYMBOL_VISIBLE year_month_day_base {
  16. year_month_day_base(YearType year,
  17. MonthType month,
  18. DayType day);
  19. YearType year;
  20. MonthType month;
  21. DayType day;
  22. typedef YearType year_type;
  23. typedef MonthType month_type;
  24. typedef DayType day_type;
  25. };
  26. //! A basic constructor
  27. template<typename YearType, typename MonthType, typename DayType>
  28. inline
  29. year_month_day_base<YearType,MonthType,DayType>::year_month_day_base(YearType y,
  30. MonthType m,
  31. DayType d) :
  32. year(y),
  33. month(m),
  34. day(d)
  35. {}
  36. } }//namespace date_time
  37. #endif