# HG changeset patch # User Chris Cannam # Date 1426017788 0 # Node ID 5ad98be7f635c3abe7b8f577fe1a5ee237052988 # Parent 10055a284716ca793c9ccba2e92ae1cce3316a4e# Parent c7e9afcbf07063c99e25f696c9f6d61b3d76ff45 Merge diff -r c7e9afcbf070 -r 5ad98be7f635 base/BaseTypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/base/BaseTypes.h Tue Mar 10 20:03:08 2015 +0000 @@ -0,0 +1,21 @@ + +#ifndef BASE_TYPES_H +#define BASE_TYPES_H + +#include + +typedef int64_t sv_frame_t; +typedef double sv_samplerate_t; + +template +bool in_range_for(const C &container, T i) +{ + if (i < 0) return false; + if (sizeof(T) > sizeof(typename C::size_type)) { + return i < static_cast(container.size()); + } else { + return static_cast(i) < container.size(); + } +} + +#endif