Private functions

  • Thread starter Chris P. Stubbs
  • Start date
J

Joachim Schmitz

Gordon said:
You have an object and do some operation on it. It returns
an odd failure. Where do you find the code that was used for
the operation, so you can figure out what's going on?

Due to inheritance and/or operator overloading, there may be plenty
of different sets of code that look like they apply, but they don't.
A friend was having this problem, so he added a few dozen abort()
calls to the code. None of the abort() calls got used. Eventually
the correct code was found, and the problem was simple - some sort
of setup had to be done with the object first - but it took a LOT
of time to find the problem.

Now, you *can* have the same problem with plain old C, especially
with a lot of #ifdef s littering the code. I've also had the
experience of adding lines like:

)))))))))))!*!*!*!}CRAP{!*!*!*!((((((((((

to heavily ifdef'd code (to figure out which section is 'live') and
not managed to provoke a syntax error.

Why not

#error CRAP

I think this is guaranteed to generate a diagnostic, if in an active part of
an ifdef

Bye, Jojo
 
L

luserXtrog

I have a base class called Action_Request, and a set of classes
corresponding to different kinds of Action_Request, each of which inherits
from Action_Request. Eg:-
[...]
comp.lang.c++ is down the hall to the left, just past the water
cooler.
Ah, common mistake. That's actually a stapler designed by the
ISO C++ committee.

And I will have you know that it integrates some new ... concepts.

And no one person fully understands it.
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top