52 std::cout <<
"[1] Construction, concat, substr, at, flatten\n";
64 std::cout <<
"size: " <<
message.size() <<
"\n";
65 std::cout <<
"char at 7: '" <<
message.at(7) <<
"' (expect 'w')\n";
71 std::cout <<
"substr(7, 5): \"" <<
just_name.
to_string() <<
"\" (expect \"world\")\n\n";
76 std::cout <<
"[2] Structural sharing: a copy is O(1) and independent\n";
86 std::cout <<
"copy: \"" <<
copy.to_string() <<
"\"\n";
87 std::cout <<
"derived: \"" <<
derived.to_string() <<
"\"\n";
88 std::cout <<
"original == copy (same content): " << std::boolalpha
94 std::cout <<
"[3] Text-editing style usage: insert and erase\n";
97 Rope<char> doc{std::string_view(
"The fox jumps over the dog.")};
98 std::cout <<
"original: \"" <<
doc.
to_string() <<
"\"\n";
110 <<
"\" (back to the original text)\n";
111 std::cout <<
"doc unchanged by either edit: \"" <<
doc.to_string() <<
"\"\n\n";
117 std::cout <<
"\n=== Aleph::Rope: immutable, structurally-shared string ===\n\n";
123 std::cout <<
"Done.\n";
Immutable, structurally-shared rope over a sequence of Char.
Rope erase(const size_t pos, const size_t len) const
Return a new rope with [pos, pos+len) removed.
Rope insert(const size_t pos, const Rope &other) const
Return a new rope with other inserted at pos.
Rope concat(const Rope &other) const
Return a new rope that is *this followed by other.
std::basic_string< Char > to_string() const
Return every character of this rope as a std::basic_string.
Rope substr(const size_t pos, const size_t len) const
Return a new rope holding [pos, pos+len) of *this.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
void message(const char *file, int line, const char *format,...)
Print an informational message with file and line info.
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
void print_rule()
Prints a horizontal rule for example output separation.
Immutable, structurally-shared rope (Aleph::Rope) for large character sequences.