• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ comparison_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
}
开发者ID:imos,项目名称:icfpc2015,代码行数:7,代码来源:lexicographic.hpp


示例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;
}
开发者ID:ARK1988,项目名称:nupic.core,代码行数:8,代码来源:tribool.hpp


示例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;
}
开发者ID:AsherBond,项目名称:PDAL,代码行数:6,代码来源:certain.hpp


示例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();
}
开发者ID:MGKhKhD,项目名称:easy-IP,代码行数:6,代码来源:set.hpp


示例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 */
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:63,代码来源:sndfile-cmp.c


示例6: comparison_error

template<class T, class Policies> inline
bool operator!=(const interval<T, Policies>& , const T& )
{
  throw comparison_error();
}
开发者ID:Niko-r,项目名称:geofeatures,代码行数:5,代码来源:set.hpp



注:本文中的comparison_error函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ compat_exit_robust_list函数代码示例发布时间:2022-05-30
下一篇:
C++ compare_strings函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap