ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/dclient/include/adt/slice.h
(Generate patch)

Comparing deliantra/dclient/include/adt/slice.h (file contents):
Revision 1.2 by sf-pippijn, Wed Oct 20 08:33:39 2010 UTC vs.
Revision 1.3 by sf-pippijn, Mon Feb 7 19:18:44 2011 UTC

14 slice_view (Container const &container, size_t offset) 14 slice_view (Container const &container, size_t offset)
15 : container (container) 15 : container (container)
16 , offset (offset) 16 , offset (offset)
17 { 17 {
18 if (container.size () < offset) 18 if (container.size () < offset)
19 throw "slice out of bounds"; 19 throw std::logic_error ("slice out of bounds");
20 else if (container.size () == offset) 20 else if (container.size () == offset)
21 throw "empty slice interval"; 21 throw std::logic_error ("empty slice interval");
22 } 22 }
23 23
24 const_iterator begin () const { return container.begin () + offset; } 24 const_iterator begin () const { return container.begin () + offset; }
25 const_iterator end () const { return container.end (); } 25 const_iterator end () const { return container.end (); }
26 26

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines