Better template error reporting

  • Thread starter Abhishek Saksena
  • Start date
A

Abhishek Saksena

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
 
A

Alan Johnson

Abhishek said:
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_check/concept_check.htm

-Alan
 
R

Rapscallion

Abhishek said:
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.
 
L

Lionel B

Rapscallion said:
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.
 
B

BigBrian

The fact is that templates are cool because they are a powerful feature
of C++. I've found that most people who say "avoid templates" say this
because they are inexperienced and don't understand how to use them.
 
R

Rapscallion

BigBrian said:
I've found that most people who say "avoid templates" say this
because they are inexperienced and don't understand how to use them.

.... either, or because they have used them extensively and thereupon
avoid them.
 
R

Richard Herring

In message said:
... either, or because they have used them extensively and thereupon
avoid them.
Or because they're just trolling.

Followups set.
 
B

BigBrian

I bet you believe Boost is "cool".

Yes, and so do most experienced C++ programmers.
 
R

Richard Herring

In message said:
I bet you believe Boost is "cool".
Belief is for theology, not programming. I know it provides some
extremely useful features, well documented, thoroughly tested on a
variety of platforms, together with reasoned arguments for why things
are done one way and not another.

Feel free to provide reasoned on-topic arguments to support your own
beliefs, and what you'd offer as an alternative to Boost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top