Welcome, Guest. Please login or register.

Author Topic: #line directive debugging vs boost preprocessor library...  (Read 1817 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
My dear Jose. You've tamed C, don't let yourself get tied down into bad habits and worrying about things for which far cleaner solutins exist. It's time to postincrement ;-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: #line directive debugging vs boost preprocessor library...
« Reply #1 on: May 26, 2007, 06:49:36 PM »
Quote
Apparently templates don't solve all problems.


Agreed, templates have their uses and they don't solve every problem of course.

However, seemingly a lot of the stuff you've worked on in C that have relied heavily on macro usage do have more immediate and safer solutions in C++, be they via templates or just basic OO.

Quote
I'd also face the problem that the C++ library is more bulky and would make my code slower and bigger (AFAIK), at least for smaller projects.


Yeah, you got me there. GCC 2.95.x in particular can produce serious bloat if you aren't careful. However I've found ways around most of its problems and thankfully many of those are solved in later versions anyway.

There's no immediate reason why a C++ program will be significantly larger if all it uses are C library functions and doesn't heavily rely on RTTI, templates, exceptions etc.

I always use C++ even for projects readily implementable in C. In that regard, you can just regard it as a safer version of C.
int p; // A