本文整理汇总了C++中comparison_error函数的典型用法代码示例。如果您正苦于以下问题:C++ comparison_error函数的具体用法?C++ comparison_error怎么用?C++ comparison_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comparison_error函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
template<class T, class Policies> inline
bool operator>(const interval<T, Policies>& x, const T& y)
{
if (detail::test_input(x, y)) throw comparison_error();
const T& xl = x.lower();
return xl > y || (xl == y && x.upper() > y);
}
示例2:
template<class T, class Policies1, class Policies2> inline
logic::tribool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
{
if (detail::test_input(x, y)) throw comparison_error();
if (x.upper() == y.lower() && x.lower() == y.upper()) return true;
if (x.upper() < y.lower() || x.lower() > y.upper()) return false;
return logic::indeterminate;
}
示例3:
template<class T, class Policies> inline
bool operator!=(const interval<T, Policies>& x, const T& y)
{
if (detail::test_input(x, y)) throw comparison_error();
return x.upper() < y || x.lower() > y;
}
示例4: comparison_error
template<class T, class Policies> inline
bool operator!=(const interval<T, Policies>& x, const T& y)
{
(void)x; (void)y;
throw comparison_error();
}
示例5: compare
static int
compare (void)
{
double buf1 [BUFLEN], buf2 [BUFLEN] ;
SF_INFO sfinfo1, sfinfo2 ;
SNDFILE * sf1 = NULL, * sf2 = NULL ;
sf_count_t len, i, nread1, nread2 ;
int retval = 0 ;
memset (&sfinfo1, 0, sizeof (SF_INFO)) ;
sf1 = sf_open (filename1, SFM_READ, &sfinfo1) ;
if (sf1 == NULL)
{ printf ("Error opening %s.\n", filename1) ;
retval = 1 ;
goto out ;
} ;
memset (&sfinfo2, 0, sizeof (SF_INFO)) ;
sf2 = sf_open (filename2, SFM_READ, &sfinfo2) ;
if (sf2 == NULL)
{ printf ("Error opening %s.\n", filename2) ;
retval = 1 ;
goto out ;
} ;
if (sfinfo1.samplerate != sfinfo2.samplerate)
{ retval = comparison_error ("Samplerates") ;
goto out ;
} ;
if (sfinfo1.channels != sfinfo2.channels)
{ retval = comparison_error ("Number of channels") ;
goto out ;
} ;
/* Calculate the framecount that will fit in our data buffers */
len = BUFLEN / sfinfo1.channels ;
while ( (nread1 = sf_readf_double (sf1, buf1, len)) > 0)
{ nread2 = sf_readf_double (sf2, buf2, nread1) ;
if (nread2 != nread1)
{ retval = comparison_error ("PCM data lengths") ;
goto out ;
} ;
for (i = 0 ; i < nread1 ; i++)
{ if (buf1 [i] != buf2 [i])
{ retval = comparison_error ("PCM data") ;
goto out ;
} ;
} ;
} ;
if ( (nread2 = sf_readf_double (sf2, buf2, nread1)) != 0)
{ retval = comparison_error ("PCM data lengths") ;
goto out ;
} ;
out :
sf_close (sf1) ;
sf_close (sf2) ;
return retval ;
} /* compare */
示例6: comparison_error
template<class T, class Policies> inline
bool operator!=(const interval<T, Policies>& , const T& )
{
throw comparison_error();
}