#include <xtd/xtd>
class example {
public:
static auto main() -> void {
dinosaurs.
add(
"Tyrannosaurus");
dinosaurs.add("Amargasaurus");
dinosaurs.add("Deinonychus");
dinosaurs.add("Compsognathus");
auto read_only_dinosaurs = dinosaurs.as_read_only();
for (auto dinosaur : read_only_dinosaurs)
console::write_line(
"\nindex_of(\"Compsognathus\"): {0}", read_only_dinosaurs.index_of(
"Compsognathus"));
dinosaurs.insert(2, "Oviraptor");
for (auto dinosaur : read_only_dinosaurs)
auto dino_array =
array<string>(read_only_dinosaurs.count() + 2);
read_only_dinosaurs.copy_to(dino_array, 1);
for (auto dinosaur : dino_array )
}
};
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
void add(const type_t &item) override
Adds an object to the end of the xtd::collections::generic::list <type_t>.
Definition list.hpp:479
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8