Boost logo

Boost :

From: M G (g_at_markus_at_[hidden])
Date: 2004-06-03 08:17:12

Greetings BOOST developers,

the "Named Variable Lib" is a lightweight macro &
template library which allows you to write:

os << NV(character) << NV(std_string);
os << NV(array_char_text) << NV(array_char_null);
os << NV(p_float)<< NVP(p_float);
p_float = 0;
os << NVP(p_float);
os << NV(the_answer_over_pi);
os << NVB(((p_device==0) || f > 1.2) &&

to get e.g.

 character='A' std_string="test"
 array_char_text[]="text" array_char_null=NULL
 p_float=0012FD9C *p_float=1.234
 (((p_device_name==0) || f > 1.2) && name=="rsd0a")=1

written to the std::ostream os (" << std::endl" in C++
source omitted for better readability).

Its main goal is to standardize the 5 macros
NV,NVP,NVB,NVM,NVMP to let one output
variable/expression together with their names
conveniently (just one very short macro per
expression) and safely (e.g. prevents
os << "x1=" << x2;).

Apart from that the NV concept could be used for other
applications, where one needs a variable/expression
and its name as a string.

For more info & download of the library goto

Feel free to try & comment ;-)

Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.

Boost list run by bdawes at, gregod at, cpdaniel at, john at