FE 0.14.0
A C++23 toolkit for writing compiler/interpreter frontends.
Loading...
Searching...
No Matches
fe::term::Cite Class Reference

A borrowed fragment whose backticks stay markup; format_cite escapes every other argument. More...

#include <fe/term.h>

Public Member Functions

constexpr Cite () noexcept=default
 The empty fragment - a context that says nothing.
template<size_t N>
constexpr Cite (const char(&s)[N]) noexcept
constexpr Cite (const Cited &cited) noexcept
constexpr Cite (std::string_view s) noexcept
constexpr std::string_view view () const noexcept
constexpr bool empty () const noexcept
constexpr operator bool () const noexcept
 Is not empty?

Detailed Description

A borrowed fragment whose backticks stay markup; format_cite escapes every other argument.

A literal and a Cited convert implicitly - both are text someone wrote as markup. Runtime text has to say so: spell it Cite(s), so data never becomes markup by accident. A const char* - a ternary of two literals, say - counts as runtime text and needs Cite(s) too.

Warning
Borrows its text like a std::string_view does - a Cited outlives the expression, a Cite does not.

Definition at line 199 of file term.h.

Constructor & Destructor Documentation

◆ Cite() [1/4]

fe::term::Cite::Cite ( )
constexprdefaultnoexcept

The empty fragment - a context that says nothing.

Referenced by Cite().

◆ Cite() [2/4]

template<size_t N>
fe::term::Cite::Cite ( const char(&) s[N])
inlineconstexprnoexcept

Definition at line 203 of file term.h.

References Cite().

◆ Cite() [3/4]

fe::term::Cite::Cite ( const Cited & cited)
inlineconstexprnoexcept

Definition at line 205 of file term.h.

◆ Cite() [4/4]

fe::term::Cite::Cite ( std::string_view s)
inlineexplicitconstexprnoexcept

Definition at line 207 of file term.h.

Member Function Documentation

◆ empty()

bool fe::term::Cite::empty ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 211 of file term.h.

◆ operator bool()

fe::term::Cite::operator bool ( ) const
inlineexplicitconstexprnoexcept

Is not empty?

Definition at line 212 of file term.h.

◆ view()

std::string_view fe::term::Cite::view ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 210 of file term.h.


The documentation for this class was generated from the following file: