Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-01 07:46:06


"Eric Niebler" <eric_at_[hidden]> writes:

> Martin Wille wrote:
>> STLPort implements std::min in the namespace _STL.
>> BOOST_USING_STD_MIN() correctly expands to: using _STL ::min
>> The (shortened) result of preprocessing is:
>> namespace _STL {
>> template <class _Tp>
>> inline const _Tp& (min)(const _Tp& __a, const _Tp& __b) { return __b
>> < __a ? __b : __a; }
>> template <class _Tp>
>> inline const _Tp& (max)(const _Tp& __a, const _Tp& __b) { return
>> __a < __b ? __b : __a; }
>> template <class _Tp, class _Compare>
>> inline const _Tp& (min)(const _Tp& __a, const _Tp& __b, _Compare __comp) {
>> return __comp(__b, __a) ? __b : __a;
>> }
>> template <class _Tp, class _Compare>
>> inline const _Tp& (max)(const _Tp& __a, const _Tp& __b, _Compare __comp) {
>> return __comp(__a, __b) ? __b : __a;
>> }
>> }
>> (the complete preprocessed source can be found at:
>> http://tinyurl.com/yrflf )
>> I must be blind, I can't spot the line that hoists the contents of
>> _STL:: into std::.
>>
>
>
> It's not there. STLPort must be #defining std to _STL.

Yes, that's what it does.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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