#include <xtd/xtd>
my_formatable_string(const string& value) : value {value} {}
string value;
};
struct my_stringable_string : public istringable<my_stringable_string> {
my_stringable_string(
const string& value) :
value {
value} {}
};
struct my_streamable_string {
friend auto operator <<(std::ostream& os,
const my_streamable_string& value)
noexcept -> std::ostream& {
return os <<
value.value;}
};
struct my_object_string : public object {
my_object_string(
const string& value) :
value {
value} {}
};
struct my_to_string_string {
};
template<>
auto xtd::to_string(
const my_to_string_string& value,
const string& format,
const std::locale& loc) ->
string {
}
struct my_string {
};
auto log_to_console(const stringable auto& value) noexcept {
console::write_line(value);
}
auto main() -> int {
log_to_console(my_formatable_string {"my_formatable_string"});
log_to_console(my_stringable_string {"my_stringable_string"});
log_to_console(my_streamable_string {"my_streamable_string"});
log_to_console(my_object_string {"my_object_string"});
log_to_console(date_time::now());
log_to_console(environment::version());
log_to_console(day_of_week::saturday);
log_to_console(42);
log_to_console(std::vector {1, 2, 3, 4, 5});
log_to_console(array {1, 2, 3, 4, 5}.select(_ * _));
log_to_console(array {1, 2, 3, 4, 5} | std::views::transform(_ * _ * _));
log_to_console(argument_out_of_range_exception {});
}
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition culture_info.hpp:43
@ value
Represnets the constant operator precedence (42).
Definition operator_precedence.hpp:30
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