72 void print(std::ostream &os = std::cout)
const noexcept { os << this->
char_; }
82 friend std::ostream &
operator<<(std::ostream &os,
const Symbol &symbol)
noexcept;
Represents a single symbol on the Turing Machine's tape.
Symbol(char symbol) noexcept
Explicit constructor to create a Symbol from a raw character.
Symbol & operator=(const Symbol &other) noexcept=default
Defaulted copy assignment operator.
char char_
The primitive character backing this Symbol.
void print(std::ostream &os=std::cout) const noexcept
Prints the symbol's character representation to the specified output stream.
auto operator<=>(const Symbol &other) const noexcept=default
Defaulted three-way comparison operator (C++20 spaceship operator).
friend std::ostream & operator<<(std::ostream &os, const Symbol &symbol) noexcept
Overloaded stream insertion operator for native stream integration.
char get_char() const noexcept
Getter for the underlying raw character.
Symbol() noexcept
Default constructor.
constexpr char kBlank
Representation of the default blank symbol used to fill the Turing Machine's tape.
std::ostream & operator<<(std::ostream &os, const Symbol &symbol) noexcept
Global implementation of the stream insertion operator for Symbol.