更好的模板错误报告 [英] Better template error reporting

查看:64
本文介绍了更好的模板错误报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

他们是一种改善模板错误信息的方法。


我正在构建一个严重依赖于模板的库。问题

如果使用该库c ++编译器生成错误

非常长且含糊不清的错误消息。这很难调试。


我有什么方法可以让这些错误变得更简单。


Abhishek

解决方案

Abhishek Saksena写道:

嗨大家好,
他们是一种改进模板错误信息的方法。 />
我正在建立一个严重依赖于模板的库。问题
如果使用该库c ++编译器生成错误,那就是非常长且含糊不清的错误信息。这很难调试。

有什么方法可以让这些错误变得更简单。

Abhishek




Boost提供概念检查。我认为这个库设计在

部分来帮助解决这个问题。

http://www.boost.org/libs/concept_ch...cept_check.htm


-Alan


Abhishek Saksena写道:

嗨大家好,
他们是一种改善模板错误信息的方法。

我正在构建一个严重依赖于模板的库。问题
如果使用该库c ++编译器生成错误,那就是非常长且含糊不清的错误信息。哪个很难调试。

有什么方法可以让这些错误变得更简单。




是的,避免使用模板。认真。现在经常使用模板

,因为deveploper认为它们很酷而不是因为它们确实是必要的。


Rapscallion写道:

Abhishek Saksena写道:

嗨大家好,
他们是一种改进模板错误信息的方法。

我正在构建一个严重依赖于模板的库。
问题是,如果使用该库c ++
编译器出错,会产生非常长且含糊的错误消息。调试哪个很难。

有什么方法可以让这些错误变得更简单。
是的,避免使用模板。




Duh#1。更正:如果你不需要它们,请避开模板。

说真的。现在经常使用模板
因为deveploper认为它们酷而不是因为它们确实是必要的。




Duh# 2。他们经常被使用,因为他们真的很有用。


-

Lionel B


Hi Guys,
Is their is a way to improve the template error message.

I am building a library which is heavly dependent on templates. The problem
is if something wrong in the usage of that library c++ compiler genrates
very long and cryptic error message. Which is hard to debug.

Is there is any way by which I can make these error bit simpler.

Abhishek

解决方案

Abhishek Saksena wrote:

Hi Guys,
Is their is a way to improve the template error message.

I am building a library which is heavly dependent on templates. The problem
is if something wrong in the usage of that library c++ compiler genrates
very long and cryptic error message. Which is hard to debug.

Is there is any way by which I can make these error bit simpler.

Abhishek



Boost provides a "Concept Check" library that I believe is designed in
part to help with that.

http://www.boost.org/libs/concept_ch...cept_check.htm

-Alan


Abhishek Saksena wrote:

Hi Guys,
Is their is a way to improve the template error message.

I am building a library which is heavly dependent on templates. The problem
is if something wrong in the usage of that library c++ compiler genrates
very long and cryptic error message. Which is hard to debug.

Is there is any way by which I can make these error bit simpler.



Yes, avoid templates. Seriously. Nowadays templates are often used
because the deveploper thinks they are ''cool'' and not because they are
really necessary.


Rapscallion wrote:

Abhishek Saksena wrote:

Hi Guys,
Is their is a way to improve the template error message.

I am building a library which is heavly dependent on templates. The
problem is if something wrong in the usage of that library c++
compiler genrates very long and cryptic error message. Which is hard
to debug.

Is there is any way by which I can make these error bit simpler.
Yes, avoid templates.



Duh #1. Correction: avoid templates if you don''t need them.
Seriously. Nowadays templates are often used
because the deveploper thinks they are ''cool'' and not because they are
really necessary.



Duh #2. And they''re often used because they''re really useful.

--
Lionel B


这篇关于更好的模板错误报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆