Shows how to use xtd::collections::generic::list class.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
dinosaurs.add("Tyrannosaurus");
dinosaurs.add("Amargasaurus");
dinosaurs.add("Mamenchisaurus");
dinosaurs.add("Deinonychus");
dinosaurs.add("Compsognathus");
for (auto dinosaur : dinosaurs)
dinosaurs.insert(2, "Compsognathus");
for (auto dinosaur : dinosaurs)
dinosaurs.remove("Compsognathus");
for (auto dinosaur : dinosaurs)
dinosaurs.trim_excess();
dinosaurs.clear();
}
};
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
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