libzed 1.11.4
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
generic.cpp
#include <iostream>
#include <z/util/generic.hpp>
int main() {
z::util::generic val1 = {"hello", 5.4, z::cplx(1.2, 4), {"a", "b"}};
z::util::generic val2 = "test";
std::cout << val1.typeString() << " : " << val1.toString(true) << std::endl;
std::cout << val2.typeString() << " : " << val2.toString(true) << std::endl;
}
A class for simple storage and manipulation of data regardless of type.
Definition generic.hpp:25
zstring toString(bool printArrays=false) const noexcept
Safely convert to a string.
zstring typeString() const noexcept
Get a character string representing the current type.