Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-08-13 05:27:13


David Abrahams wrote:
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
>> David Abrahams wrote:
>>> Is it really true that I can write
>>>
>>> bind(f, _1) > _2
>>>
>>> but can't write
>>>
>>> _1 > _2
>>>
>>> ??
>>>
>>> I can't imagine a good reason for that restriction, but I don't see
>>> any indication that the latter is supported in the docs.
>>
>> A limitation of the current implementation. On some compilers, the
>> placeholders are function pointers and _1 > _2 can't be
>> overloaded. There's no other technical reason that prevents _1 > _2
>> (or _1 > 0) from working; it'd fall out of the specification.
>
> Thanks for the info.
>
> What abut the trick of making the placeholders references in an
> unnamed namespace to objects in a named one?

The problem is that on some compilers we can't define objects in precompiled
headers. This is not an issue for TR1 because the placeholders are only
declared 'extern' in the header, only for the Boost implementation ("least
common denominator" for historical reasons :-)


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