#include <xtd/any_object>
#include <xtd/console>
#include <xtd/date_time>
int value = 0;
string to_string() const noexcept
override {
return string::format(
"{}", value);}
bool equals(
const foo1& f)
const noexcept override {
return value ==
f.value;}
int32 compare_to(
const foo1& f)
const noexcept override {
return value <
f.value ? -1 : value >
f.value ? 1 : 0;}
};
struct foo2 {
int value = 0;
bool operator ==(
const foo2& f)
const noexcept {
return value ==
f.value;}
bool operator <(
const foo2& f)
const noexcept {
return value <
f.value;}
bool operator >(
const foo2& f)
const noexcept {
return value >
f.value;}
};
template<>
std::string
xtd::to_string(
const foo2& value,
const std::string& fmt,
const std::locale& loc) {
return xtd::int32_object {value.value}.to_string(fmt, loc);}
template<>
struct std::hash<foo2> {
};
auto main() -> int {
}
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
const object & value() const
Gets the value of the current xtd::any_object object if it has been assigned a valid underlying value...
Definition any_object.hpp:67
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
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
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.
object()=default
Create a new instance of the ultimate base class object.
virtual xtd::string to_string() const noexcept
Returns a xtd::string that represents the current object.
#define typeof_
Used to obtain the type object of a specified type or object.
Definition typeof.hpp:45
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
box_integer< int32 > int32_object
Represent a boxed int32.
Definition int32_object.hpp:29
bool is(std::any value)
Checks if the result of an expression is compatible with a given type.
Definition is.hpp:365
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
@ a
The A key.
Definition console_key.hpp:88
@ f
The F key.
Definition console_key.hpp:98
@ v
The V key.
Definition console_key.hpp:130
@ o
The O key.
Definition console_key.hpp:116
@ wednesday
Indicates wednesday.
Definition day_of_week.hpp:33
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