Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2007-07-07 10:08:25


Hi Joaquin!

On 7/7/07, "JOAQUIN LOPEZ MU?Z" <joaquin_at_[hidden]> wrote:
> ----- Mensaje original -----
> De: Dean Michael Berris <mikhailberis_at_[hidden]>
> Fecha: Sábado, Julio 7, 2007 9:17 am
> Asunto: Re: [boost] extern placeholders and MSVC 8
> Para: boost_at_[hidden]
>
> [...]
> > As for background, I'm trying to achieve what Boost.Bind does with:
> > boost::bind(&function, _1, _2) -- where _1 and _2 are used mainly as
> > placeholders -- without having to resort to unnamed namespaces
> > (namespace { ... }) to avoid ODR violation. I'm looking at doing
> > something (for the network library I'm working on):
> >
> > network::message m;
> > m << transform(to_upper_, headers_);
> >
> > In the above, to_upper_ and headers_ are placeholders which are used
> > mainly for type deduction -- while transform returns an instance
> > of a type (a functor) with template parameters dependent on the
> > types of to_upper_ and headers_.
>
> If you're using the placeholders exclusively as syntactic tokens,
> then the following ODR-abiding technique can be of use:
>
> http://lists.boost.org/Archives/boost/2006/07/108355.php
>

Nice! That clears things up a lot! :-)

> On why this technique cannot be used for more advanced placeholders
> such as those of Boost.Lambda, see:
>
> http://lists.boost.org/Archives/boost/2007/06/123375.php
> http://lists.boost.org/Archives/boost/2007/06/123376.php
>

Thanks for the links!

> HTH,

They definitely do. :)

Thank you again!

-- 
Dean Michael C. Berris
http://cplusplus-soup.blogspot.com/
mikhailberis AT gmail DOT com
+63 928 7291459

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