X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FRange.cti;h=cd95daa9973c7960685a243e035d5b36fd75196d;hb=4101c2b818ec67e7469ebb44f030eed2185c4ab0;hp=38744c353a61a9604d1999005d3402f286ded796;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Utils/Range.cti b/senf/Utils/Range.cti index 38744c3..cd95daa 100644 --- a/senf/Utils/Range.cti +++ b/senf/Utils/Range.cti @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2008 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund @@ -28,10 +28,10 @@ // Custom includes #define prefix_ inline -///////////////////////////////cti.p/////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// template -prefix_ boost::iterator_range< +prefix_ boost::iterator_range< boost::transform_iterator< Fn, typename boost::range_const_iterator::type > > senf::make_transform_range(Range const & range, Fn const & fn) @@ -42,7 +42,7 @@ senf::make_transform_range(Range const & range, Fn const & fn) } template -prefix_ boost::iterator_range< +prefix_ boost::iterator_range< boost::transform_iterator< Fn, typename boost::range_iterator::type > > senf::make_transform_range(Range & range, Fn const & fn) @@ -52,7 +52,25 @@ senf::make_transform_range(Range & range, Fn const & fn) boost::make_transform_iterator(boost::end(range), fn) ); } -///////////////////////////////cti.e/////////////////////////////////////// +template +prefix_ void senf::copy_range(Range const & range, Iterator const & i) +{ + std::copy(boost::begin(range), boost::end(range), i); +} + +template +prefix_ void senf::copy_range(Range & range, Iterator const & i) +{ + std::copy(boost::begin(range), boost::end(range), i); +} + +template +prefix_ bool senf::has_one_elt(Range r) +{ + return ! r.empty() && boost::next(r.begin()) == r.end(); +} + +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_