#ifndef INCLUDED_CLOCKTIMECONV_
#define INCLUDED_CLOCKTIMECONV_

// previously included by demo.cc. Not needed anymore

#include <type_traits>

namespace std {
namespace chrono {

template <class DestClock, class SourceClock>
struct clock_time_conversion {};

template <class ClockType>
struct clock_time_conversion<ClockType, ClockType> 
{
    template <class ChronoDuration>
    [[nodiscard]] time_point<ClockType, ChronoDuration> operator()
            (time_point<ClockType, ChronoDuration> const & timePoint) const
               noexcept(is_arithmetic<typename ChronoDuration::rep>::value) 
                                                        // strengthened
    {
        std::cout << "clock_time_conversion 1\n";
        return timePoint;
    }
};

template <>
struct clock_time_conversion<system_clock, system_clock> 
{
    template <class ChronoDuration>
    [[nodiscard]] sys_time<ChronoDuration> operator()(
        sys_time<ChronoDuration> const &timePoint) const
        noexcept(is_arithmetic<typename ChronoDuration::rep>::value)
                                                        // strengthened
    {
        std::cout << "clock_time_conversion 2\n";
        return timePoint;
    }
};

//              No utc_clock in chrono.
//              =======================
//
//template <>
//struct clock_time_conversion<utc_clock, utc_clock> {
//    template <class ChronoDuration>
//    [[nodiscard]] utc_time<ChronoDuration> operator()(const utc_time<ChronoDuration>& timePoint) const
//        noexcept(is_arithmetic_v<typename ChronoDuration::rep>) /* strengthened */ {
//        return timePoint;
//    }
//};
//
//// [time.clock.cast.sys.utc]
//
//template <>
//struct clock_time_conversion<utc_clock, system_clock> {
//    template <class ChronoDuration>
//    [[nodiscard]] utc_time<common_type_t<ChronoDuration, seconds>> operator()(const sys_time<ChronoDuration>& _Sys_time) const {
//        return utc_clock::from_sys(_Sys_time);
//    }
//};
//
//template <>
//struct clock_time_conversion<system_clock, utc_clock> {
//    template <class ChronoDuration>
//    [[nodiscard]] sys_time<common_type_t<ChronoDuration, seconds>> operator()(const utc_time<ChronoDuration>& _Utc_time) const {
//        return utc_clock::to_sys(_Utc_time);
//    }
//};

}
}

#endif
