Lumiera  0.pre.03
»edit your freedom«
Literal Class Reference

#include "lib/symbol.hpp"

Description

inline string literal This is a marker type to indicate that

  • the string was given literally
  • storage is somewhere, not managed by Literal, yet guaranteed to exist during the whole lifetime
  • it is transparently convertible to/from C-string
  • defaults to the empty string
  • can not be altered
Examples:
/Werk/devel/lumi/src/lib/test/test-helper.hpp.

Definition at line 85 of file symbol.hpp.

Public Member Functions

 Literal () noexcept
 empty string by default More...
 
 Literal (const char *literal) noexcept
 
 Literal (Literal const &o) noexcept
 
const char * c () const
 
bool empty () const
 
 operator CStr () const
 
bool operator== (CStr cString) const
 equality on Literal and Symbol values is defined based on the content, not the address. More...
 

Protected Member Functions

Literaloperator= (CStr newStr) noexcept
 Assignment generally prohibited.
 

Private Attributes

CStr str_
 

Constructor & Destructor Documentation

◆ Literal()

Literal ( )
inlinenoexcept

empty string by default

Note
storage guaranteed to exist

Definition at line 177 of file symbol.hpp.

References lib::hash_value(), and Literal::operator==().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator==()

bool operator== ( CStr  charPtr) const

equality on Literal and Symbol values is defined based on the content, not the address.

Definition at line 102 of file symbol-impl.cpp.

Referenced by Literal::Literal(), and lib::operator==().

+ Here is the caller graph for this function:
+ Inheritance diagram for Literal:
+ Collaboration diagram for Literal:

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