Next: , Previous: , Up: C++ Location Values   [Contents][Index]


10.1.5.2 C++ location

Constructor on location: location (const position& begin, const position& end)

Create a Location from the endpoints of the range.

Constructor on location: location (const position& pos = position())
Constructor on location: location (filename_type* file, counter_type line, counter_type col)

Create a Location denoting an empty range located at a given point.

Method on location: void initialize (filename_type* file = nullptr, counter_type line = 1, counter_type col = 1)

Reset the location to an empty range at the given values.

Instance Variable of location: position begin
Instance Variable of location: position end

The first, inclusive, position of the range, and the first beyond.

Method on location: void columns (counter_type width = 1)
Method on location: void lines (counter_type height = 1)

Forwarded to the end position.

Method on location: location operator+ (counter_type width)
Method on location: location operator+= (counter_type width)
Method on location: location operator- (counter_type width)
Method on location: location operator-= (counter_type width)

Various forms of syntactic sugar for columns.

Method on location: location operator+ (const location& end)
Method on location: location operator+= (const location& end)

Join two locations: starts at the position of the first one, and ends at the position of the second.

Method on location: void step ()

Move begin onto end.

Method on location: bool operator== (const location& that)
Method on location: bool operator!= (const location& that)

Whether *this and that denote equal/different ranges of positions.

Function: std::ostream& operator<< (std::ostream& o, const location& p)

Report p on o, taking care of special cases such as: no filename defined, or equal filename/line or column.


Next: Exposing the Location Classes, Previous: C++ position, Up: C++ Location Values   [Contents][Index]