Boost logo

Boost Users :

Subject: Re: [Boost-users] implementing a new Range
From: Anthony Foglia (AFoglia_at_[hidden])
Date: 2009-08-26 09:45:31


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

Basically you need to define range_begin and range_end in the namespace
of the object and two traits classes in boost's namespace.

-- 
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net