Boost logo

Proto :

Subject: Re: [proto] expanding Proto's library of callables
From: Eric Niebler (eric_at_[hidden])
Date: 2010-12-28 10:18:34


On 12/28/2010 5:39 AM, Thomas Heller wrote:
> I just saw that you added functional::at.
> I was wondering about the rationale of your decision to make it a non
> template.
> My gut feeling would have been to have proto::functional::at<N>(seq)
> and not proto::functional::at(seq, N).

Think of the case of Phoenix placeholders, where in the index is a
parameter:

  when< terminal<placeholder<_> >, _at(_state, _value) >

For the times when the index is not a parameter, you can easily do:

  _at(_state, mpl::int_<N>())

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Proto list run by eric at boostpro.com