#include <xtd/boxing>
#include <xtd/console>
#include <xtd/date_time>
#include <xtd/day_of_week>
#include <xtd/typeof>
foo() = default;
foo(int value) : value {value} {}
int value = 0;
int32 compare_to(
const foo&
other)
const noexcept override {
return value -
other.value;}
bool equals(
const foo&
other)
const noexcept override {
return value ==
other.value;}
string to_string()
const noexcept override {
return string::format(
"{}", value);}
};
namespace std {
template<>
struct hash<foo> {
size_t operator()(const foo&) {return 0;}
};
}
template<typename type_t>
string get_boxed_info(const type_t& value) {
auto boxed_value =
boxing(value);
return string::format(
"[type = {}, boxed type = {}, value = {}]",
typeof_(value),
typeof_(boxed_value), boxed_value.to_string());
}
auto main() -> int {
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.hpp:70
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition ihashable.hpp:21
Provides a way to represent the current object as a string.
Definition istringable.hpp:22
#define typeof_
Used to obtain the type object of a specified type or object.
Definition typeof.hpp:45
auto boxing(const type_t &value) noexcept
Allows to box an object.
Definition boxing.hpp:53
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
@ saturday
Indicates saturday.
Definition day_of_week.hpp:39
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
string to_string() const noexcept override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:375
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Definition read_only_span.hpp:272
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
Definition read_only_span.hpp:296