Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:12

0001 #ifndef FWCore_Utilities_Range_h
0002 #define FWCore_Utilities_Range_h
0003 
0004 namespace edm {
0005   /*
0006       *class which implements begin() and end() to use range-based loop with
0007       pairs of iterators or pointers.
0008       */
0009 
0010   template <class T>
0011   class Range {
0012   public:
0013     Range(T begin, T end) : begin_(begin), end_(end) {}
0014 
0015     T begin() const { return begin_; }
0016     T end() const { return end_; }
0017 
0018     bool empty() const { return begin_ == end_; }
0019 
0020   private:
0021     const T begin_;
0022     const T end_;
0023   };
0024 };  // namespace edm
0025 
0026 #endif