Boost logo

Boost :

From: Miki Jovanovic (miki_at_[hidden])
Date: 2000-02-17 10:10:39


Hi all,

How do you keep track of places in your code which you need to re-visit
to improve, implement of check otherwise? For the longest time I was
using comments like:

  // TODO: Fix this.

But little while ago there was a discussion on one of the boards about
#pragma message, and I wrote a macro that I found irreplaceable since.
So, here it is, and you all can tell me if there is a place in the
boost library for it.

#define hidden_quote( s ) #s
#define hidden_numquote( n ) hidden_quote( n )
#define TODO( msg ) message( __FILE__ "(" hidden_numquote( __LINE__ )
"): TODO: " msg )

The only macro that should be used is the TODO. It lets you put
comments in your code like this:

  #pragma TODO( "Fix this." )

This line would produce compiler output like:

C:\Projects\Test\Test.c(34): TODO: Fix this.

Nice thing about the macro is that it identifies file and line number,
and it lets IDE's take you there immediately. Not so nice thing...
#pragma is not in the macro. If anyone can put it in, please let me
know.

Cheers,

Miki Jovanovic.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk