year_month_day.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
  9. */
  10. namespace boost {
  11. namespace date_time {
  12. //! Allow rapid creation of ymd triples of different types
  13. template<typename YearType, typename MonthType, typename DayType>
  14. struct year_month_day_base {
  15. year_month_day_base(YearType year,
  16. MonthType month,
  17. DayType day);
  18. YearType year;
  19. MonthType month;
  20. DayType day;
  21. typedef YearType year_type;
  22. typedef MonthType month_type;
  23. typedef DayType day_type;
  24. };
  25. //! A basic constructor
  26. template<typename YearType, typename MonthType, typename DayType>
  27. inline
  28. year_month_day_base<YearType,MonthType,DayType>::year_month_day_base(YearType y,
  29. MonthType m,
  30. DayType d) :
  31. year(y),
  32. month(m),
  33. day(d)
  34. {}
  35. } }//namespace date_time
  36. #endif