year_month_day.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. BOOST_CXX14_CONSTEXPR
  17. year_month_day_base(YearType year,
  18. MonthType month,
  19. DayType day);
  20. YearType year;
  21. MonthType month;
  22. DayType day;
  23. typedef YearType year_type;
  24. typedef MonthType month_type;
  25. typedef DayType day_type;
  26. };
  27. //! A basic constructor
  28. template<typename YearType, typename MonthType, typename DayType>
  29. inline BOOST_CXX14_CONSTEXPR
  30. year_month_day_base<YearType,MonthType,DayType>::year_month_day_base(YearType y,
  31. MonthType m,
  32. DayType d) :
  33. year(y),
  34. month(m),
  35. day(d)
  36. {}
  37. } }//namespace date_time
  38. #endif