FE 0.6.1
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches

Position in a source file; pass around as value. More...

#include <fe/loc.h>

Public Member Functions

 Pos ()=default
 Creates an invalid Position.
 Pos (uint16_t row)
 Pos (uint16_t row, uint16_t col)
 operator bool () const
 Is a valid Position?
auto operator<=> (const Pos &) const =default
void dump () const

Public Attributes

uint16_t row = 0
uint16_t col = 0

Friends

std::ostream & operator<< (std::ostream &os, Pos pos)
 fe/loc.h only declares the stream output and dump helpers.

Detailed Description

Position in a source file; pass around as value.

Definition at line 10 of file loc.h.

Constructor & Destructor Documentation

◆ Pos() [1/3]

fe::Pos::Pos ( )
default

Creates an invalid Position.

Referenced by operator<<, and operator<=>().

◆ Pos() [2/3]

fe::Pos::Pos ( uint16_t row)
inline

Definition at line 12 of file loc.h.

References row.

◆ Pos() [3/3]

fe::Pos::Pos ( uint16_t row,
uint16_t col )
inline

Definition at line 14 of file loc.h.

References col, and row.

Member Function Documentation

◆ dump()

void fe::Pos::dump ( ) const

Definition at line 27 of file loc.cpp.h.

◆ operator bool()

fe::Pos::operator bool ( ) const
inlineexplicit

Is a valid Position?

Definition at line 18 of file loc.h.

References row.

◆ operator<=>()

auto fe::Pos::operator<=> ( const Pos & ) const
default

References Pos().

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Pos pos )
friend

fe/loc.h only declares the stream output and dump helpers.

Include fe/loc.cpp.h in exactly one translation unit for the default implementation, or provide your own definitions instead.

Definition at line 10 of file loc.cpp.h.

References col, Pos(), and row.

Member Data Documentation

◆ col

uint16_t fe::Pos::col = 0

Definition at line 23 of file loc.h.

Referenced by operator<<, and Pos().

◆ row

uint16_t fe::Pos::row = 0

Definition at line 22 of file loc.h.

Referenced by operator bool(), operator<<, Pos(), and Pos().


The documentation for this struct was generated from the following files: