From 5e0cf747bbe258e5a29b25088aae9188da3108b1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 11 Dec 2020 09:25:56 -0700 Subject: [PATCH] Temporal: removed unused std::numeric_limits<> definitions for timeline types There can be no single ::max() or ::min() value for these types because the time domain matters. With a given tempo map, a certain beat value represent a time before or after the maximum possible audio domain value --- libs/temporal/temporal/timeline.h | 33 ------------------------------- 1 file changed, 33 deletions(-) diff --git a/libs/temporal/temporal/timeline.h b/libs/temporal/temporal/timeline.h index ba95f03d06..347fab5687 100644 --- a/libs/temporal/temporal/timeline.h +++ b/libs/temporal/temporal/timeline.h @@ -428,39 +428,6 @@ class LIBTEMPORAL_API timecnt_t { } /* end namespace Temporal */ -/* because timepos_t is just a typedef here, C++ won't let this be redefined - * (numeric_limits are already implicitly defined. - */ - -namespace std { - -/* The utility of these two specializations of std::numeric_limits<> is not - * clear, since both timepos_t and timecnt_t have a time domain, and comparing - * across time domains, while possible, is expensive. - * - * To avoid hidden costs, it seems easier to use timepos_t::max and - * timecnt_t::max although these have a similar fundamental problem. - */ - -template<> -struct numeric_limits { - static Temporal::timepos_t min() { - return Temporal::timepos_t::from_superclock (0); - } - static Temporal::timepos_t max() { - return Temporal::timepos_t::from_superclock (4611686018427387903); /* pow (2,62) - 1 */ - } -}; - -template<> -struct numeric_limits { - static Temporal::timecnt_t min() { return Temporal::timecnt_t::from_superclock (0); } - static Temporal::timecnt_t max() { return Temporal::timecnt_t::from_superclock (4611686018427387903); /* pow (2,62) - 1 */ } -}; - -} - - namespace std { std::ostream& operator<< (std::ostream & o, Temporal::timecnt_t const & tc); std::ostream& operator>> (std::istream & o, Temporal::timecnt_t const & tc);