Boost logo

Boost Users :

Subject: [Boost-users] [range] Tuple initialization?
From: Marcin Zalewski (marcin.zalewski_at_[hidden])
Date: 2010-12-01 11:36:15


I have a following fragment of code:

        local = boost::begin(f(*current));
        local_end = boost::end(f(*current));

local and local_end are two iterators, f is a function that returns a
range, and current is some iterator I have around. I would like to
initialize two iterators from the range returned by f, but it seems
that I only have two choices: create a local range variable or call f
twice and have two temporary ranges. Am I missing something, or are
these indeed the only choices? Would it be reasonable to have a
begin_end (or such) function that returns a tuple of iterators from a
range for tuple initialization of two iterators? Currently, the range
concepts do not require anything of the sort.

Thanks,
Marcin


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