Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-03-22 07:02:40

"Markus Schöpflin" wrote
> Richard Corden wrote:
> [...]
>> Can I ask what is the purpose of adding parenthesis to the qualified name?
>> ADL should not take place for the qualified name? Do some compilers get
>> this wrong?
>> Is there another reason?
> See

FYI I have discovered that in my useage of min the advice doesnt seem to help,
my use being default construction of a temporary of type named max or min:
>From one of my test files I currently ended up using the obvious workaround:

// here boost::pqs::time::min is a typedef for a quantity of time in minutes
#if ! defined (min)
     BOOST_CHECK(units_str( boost::pqs::time::min()) == "min");
    //use of min() looks like the macro so just create a variable
    boost::pqs::time::min min;
    BOOST_CHECK(units_str(min) == "min");

The only other option would seem to be to "save" the body of the min macro
undefine it and then redefine it later, IOW not possible in practise AFAIK.

If anyone has ideas what the preferred option is in this situation I would be
interested to know?

---------- Boost.Inspect and min max

Inspect reports the above as a violation of boost guidelines of course, though I
have attended to them. I dont know quite what else to do about it as the names
are the recommended SI names. Ideally I would like to tell inspect to disable
this "violation" here as I've attended to it etc.

Inspect also reports use of min in comments as in the 2nd /3rd line below as a

#if defined (min)
// some compilers use a min() macro
// this causes a failure of useage of e.g my_stuff::min()
// for other purposes

Finally Boost.Inspect reports use in strings as a violation:

std::string my_min_str = "just a min()";

I will try to come up with a patch for Boost.Inspect.

... Meanwhile FYI.

Andy Little

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