[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    Re: [Boost-users] implementing a new Range
From:       Neil Groves <neil () grovescomputing ! com>
Date:       2009-08-26 16:00:27
Message-ID: 1ca589290908260900g789b8d71wfa90f80dd41c3d66 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, Aug 26, 2009 at 4:29 PM, Mathias Gaunard <
mathias.gaunard@ens-lyon.org> wrote:

> Anthony Foglia wrote:
>
>> Alex Flint wrote:
>>
>>> I'm using a math library that provides a Vector class, but it does not
>>> have begin() or end() method, or any other normal container methods. I
>>> would like to pass it to functions that take a Range object as a
>>> parameter. How can I do this?
>>>
>>
>>    I've done this once as an exercise, but not well enough to walk you
>> through it.  But the documentation's pretty straightforward, once you find
>> the right section:
>>
>>
>> http://www.boost.org/doc/libs/1_39_0/libs/range/doc/boost_range.html#method2
>>
>
> I thought you could overload begin/end directly and it would get picked up
> by ADL, but it looks like it's range_begin/range_end.
> That really should be changed.
>

I disagree that this should be changed. This arrangement allows qualified
calls to boost::begin(x), boost::end(x) to continue to work and find the
approriate range_begin(), range_end() functions via argument dependent
lookup. If this rationale does not appear correct, then please explain a
little further. I would be happy to make the change if I understand that it
really would be an improvement.

Regards,
Neil Groves

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Wed, Aug 26, 2009 at 4:29 PM, Mathias Gaunard \
<span dir="ltr">&lt;<a \
href="mailto:mathias.gaunard@ens-lyon.org">mathias.gaunard@ens-lyon.org</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="im">Anthony Foglia \
wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Alex Flint wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I&#39;m using a math library that \
provides a Vector class, but it does not<br> have begin() or end() method, or any \
other normal container methods. I<br> would like to pass it to functions that take a \
Range object as a<br> parameter. How can I do this?<br>
</blockquote>
<br>
    I&#39;ve done this once as an exercise, but not well enough to walk you through \
it.  But the documentation&#39;s pretty straightforward, once you find the right \
section:<br> <br>
<a href="http://www.boost.org/doc/libs/1_39_0/libs/range/doc/boost_range.html#method2" \
target="_blank">http://www.boost.org/doc/libs/1_39_0/libs/range/doc/boost_range.html#method2</a> \
<br> </blockquote>
<br></div>
I thought you could overload begin/end directly and it would get picked up by ADL, \
but it looks like it&#39;s range_begin/range_end.<br> That really should be \
changed.<div><div></div><div class="h5"></div></div></blockquote><div><br>I disagree \
that this should be changed. This arrangement allows qualified calls to \
boost::begin(x), boost::end(x) to continue to work and find the approriate \
range_begin(), range_end() functions via argument dependent lookup. If this rationale \
does not appear correct, then please explain a little further. I would be happy to \
make the change if I understand that it really would be an improvement.<br> \
<br>Regards,<br>Neil Groves<br> </div><br></div><br>



_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic