|
![](/i/fill.gif) |
Micha Riser inspired the electrons to say:
> Warp wrote:
>
>> No, no! Don't kludge it. You can never know whether the STL
>> implementations
>> are faster than that.
>> The correct answer is to put 'using namespace std;' in config.h. (I
>> don't
>> know why this hasn't be done already.)
>>
Oh no! No! please, don't....... Okay, importing the whole std namespace
globally is ugly and was never recommented in any documentation I read,
also I personally never do that too. I just import either locally or import
explicitely.
> Yep, of course you are right. I just could not find a reference to min/max
> in STL in my documentation. To get it working it is already enough to add
>
> using std::max;
> using std::min;
Exactly ;)
> into config.h. I even wondered why this wasn't in STL :D
Take a closer look.
I did it and found it in /usr/include/g++-v31/stl_algobase.h beginning at
line 130. Look there, the Standard C directives min and max gets removed,
and then replaced by its template functions and some specializations.
Cheers,
Christian Parpart.
p.s.: I also posted that in the .general feed. Hugh? I just looked here
later ;)
Post a reply to this message
|
![](/i/fill.gif) |