diff --git a/src/xtd.core/CMakeLists.txt b/src/xtd.core/CMakeLists.txt index d6c162db4620..1479e8b5eac4 100644 --- a/src/xtd.core/CMakeLists.txt +++ b/src/xtd.core/CMakeLists.txt @@ -522,7 +522,31 @@ add_sources( include/xtd/diagnostics/trace_source include/xtd/diagnostics/trace_switch.h include/xtd/diagnostics/trace_switch + include/xtd/internal/__as_char.h + include/xtd/internal/__as_bool.h + include/xtd/internal/__as_wchar.h + include/xtd/internal/__as_char8.h + include/xtd/internal/__as_char16.h + include/xtd/internal/__as_char32.h + include/xtd/internal/__as_double.h + include/xtd/internal/__as_float.h + include/xtd/internal/__as_byte.h + include/xtd/internal/__as_int16.h include/xtd/internal/__as_enum.h + include/xtd/internal/__as_enum + include/xtd/internal/__as_uint16.h + include/xtd/internal/__as_int64.h + include/xtd/internal/__as_uint64.h + include/xtd/internal/__as_slong.h + include/xtd/internal/__as_int32.h + include/xtd/internal/__as_uint32.h + include/xtd/internal/__as_sbyte.h + include/xtd/internal/__as_ustring.h + include/xtd/internal/__as_string.h + include/xtd/internal/__as_pointer.h + include/xtd/internal/__as_ulong.h + include/xtd/internal/__as_decimal.h + include/xtd/internal/__as_generic.h include/xtd/internal/__binary_formatter.h include/xtd/internal/__binary_formatter include/xtd/internal/__boolean_formatter.h diff --git a/src/xtd.core/include/xtd/as.h b/src/xtd.core/include/xtd/as.h index 64a37549b1fe..5bce50b099e6 100644 --- a/src/xtd.core/include/xtd/as.h +++ b/src/xtd.core/include/xtd/as.h @@ -2,20965 +2,44 @@ /// @brief Contains xtd::as method. #pragma once #include "any.h" -#include "convert.h" -#include "convert_pointer.h" -#include "convert_string.h" #include "invalid_cast_exception.h" #include "types.h" +#include #define __XTD_CORE_INTERNAL__ #include "internal/__as_enum.h" +#include "internal/__as_generic.h" +#undef __XTD_CORE_INTERNAL__ +#include "convert.h" +#define __XTD_CORE_INTERNAL__ +#include "internal/__as_bool.h" +#include "internal/__as_byte.h" +#include "internal/__as_char.h" +#include "internal/__as_char8.h" +#include "internal/__as_char16.h" +#include "internal/__as_char32.h" +#include "internal/__as_decimal.h" +#include "internal/__as_double.h" +#include "internal/__as_float.h" +#include "internal/__as_int16.h" +#include "internal/__as_int32.h" +#include "internal/__as_int64.h" +#include "internal/__as_sbyte.h" +#include "internal/__as_slong.h" +#include "internal/__as_uint16.h" +#include "internal/__as_uint32.h" +#include "internal/__as_uint64.h" +#include "internal/__as_ulong.h" +#include "internal/__as_ustring.h" +#include "internal/__as_wchar.h" +#undef __XTD_CORE_INTERNAL__ +#include "convert_pointer.h" +#define __XTD_CORE_INTERNAL__ +#include "internal/__as_pointer.h" +#undef __XTD_CORE_INTERNAL__ +#include "convert_string.h" +#define __XTD_CORE_INTERNAL__ +#include "internal/__as_string.h" #undef __XTD_CORE_INTERNAL__ -#include - -/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more. -namespace xtd { - // ___________________________________________________________________________________________ - // generic - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = 42; - /// int result = as(value); - /// @endcode - template - new_type_t as(std::any value) { - try { - return std::any_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// int result = as(value); - /// @endcode - template - new_type_t as(bool value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(xtd::byte value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// int result = as(value); - /// @endcode - template - new_type_t as(char value) { - return static_cast(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// int result = as(value); - /// @endcode - template - new_type_t as(char8 value) { - return static_cast(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u'a'; - /// int result = as(value); - /// @endcode - template - new_type_t as(char16 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = U'a'; - /// int result = as(value); - /// @endcode - template - new_type_t as(char32 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = L'a'; - /// int result = as(value); - /// @endcode - template - new_type_t as(wchar value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.0l; - /// int result = as(value); - /// @endcode - template - new_type_t as(decimal value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.0; - /// int result = as(value); - /// @endcode - template - new_type_t as(double value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.0f; - /// int result = as(value); - /// @endcode - template - new_type_t as(float value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(int16 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(int32 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(int64 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(slong value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(sbyte value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(uint16 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(uint32 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(uint64 value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42; - /// float result = as(value); - /// @endcode - template - new_type_t as(xtd::ulong value) { - return static_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "Gammasoft"; - /// object result = as(value); - /// @endcode - template - new_type_t as(const xtd::ustring& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "Gammasoft"; - /// object result = as(value); - /// @endcode - template - new_type_t as(xtd::ustring& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @cond - template - new_type_t as(const xtd::ustring& value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(xtd::byte value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(int16 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(int32 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(int64 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(slong value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(sbyte value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(uint16 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(uint32 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(uint64 value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - template - new_type_t as(xtd::ulong value, xtd::byte from_base) { - throw invalid_cast_exception {csf_}; - } - /// @endcond - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(const std::string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(std::string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(const std::u8string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(std::u8string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(const std::u16string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(std::u16string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(const std::u32string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(std::u32string& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(const std::wstring& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @exception xtd::invalid_cast_exception value bad type - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - template - new_type_t as(std::wstring& value) { - try { - return dynamic_cast(value); - } catch (const std::exception& e) { - throw invalid_cast_exception(e.what(), csf_); - } - throw std::bad_cast(); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(const char* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(char* value) { - return reinterpret_cast(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(const char8* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(char8* value) { - return reinterpret_cast(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(const char16* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(char16* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(const char32* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(char32* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(const wchar* value) { - return reinterpret_cast(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new new_type_t object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"Gammasoft"; - /// intptr result = as(value); - /// @endcode - template - new_type_t as(wchar* value) { - return reinterpret_cast(value); - } - - // ___________________________________________________________________________________________ - // xtd::convert specialization - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::any value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(bool value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(xtd::byte value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char value) { - return xtd::convert::to_boolean(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char8 value) { - return xtd::convert::to_boolean(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char16 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char32 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(wchar value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(decimal value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(double value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(float value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(int16 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(int32 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(int64 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(slong value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(sbyte value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(uint16 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(uint32 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(uint64 value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(xtd::ulong value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const xtd::ustring& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(xtd::ustring& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const std::string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::string& value) { - return xtd::convert::to_boolean(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const std::u8string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::u8string& value) { - return xtd::convert::to_boolean(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const std::u16string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::u16string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const std::u32string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::u32string& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const std::wstring& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(std::wstring& value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const char* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char* value) { - return xtd::convert::to_boolean(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const char8* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char8* value) { - return xtd::convert::to_boolean(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const char16* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char16* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const char32* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(char32* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(const wchar* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new bool object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// bool result = as(value); - /// @endcode - template<> - inline bool as(wchar* value) { - return xtd::convert::to_boolean(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::any value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(bool value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(xtd::byte value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char value) { - return xtd::convert::to_byte(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char8 value) { - return xtd::convert::to_byte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char16 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char32 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(wchar value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(decimal value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(double value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(float value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(int16 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(int32 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(int64 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(slong value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(sbyte value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(uint16 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(uint32 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(uint64 value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(xtd::ulong value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a byte. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const xtd::ustring& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a byte. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(xtd::ustring& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a byte. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// xtd::byte result = as(value, 16); - /// @endcode - template<> - inline xtd::byte as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_byte(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const std::string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::string& value) { - return xtd::convert::to_byte(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const std::u8string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::u8string& value) { - return xtd::convert::to_byte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const std::u16string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::u16string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const std::u32string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::u32string& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const std::wstring& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(std::wstring& value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const char* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char* value) { - return xtd::convert::to_byte(value); - } - -#if defined(__cpp_lib_char8_t) -/// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const char8* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char8* value) { - return xtd::convert::to_byte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const char16* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char16* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const char32* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(char32* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(const wchar* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::byte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// xtd::byte result = as(value); - /// @endcode - template<> - inline xtd::byte as(wchar* value) { - return xtd::convert::to_byte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::any value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// char result = as(value); - /// @endcode - template<> - inline char as(bool value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// char result = as(value); - /// @endcode - template<> - inline char as(xtd::byte value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// char result = as(value); - /// @endcode - template<> - inline char as(char value) { - return xtd::convert::to_char(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// char result = as(value); - /// @endcode - template<> - inline char as(char8 value) { - return xtd::convert::to_char(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// char result = as(value); - /// @endcode - template<> - inline char as(char16 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// char result = as(value); - /// @endcode - template<> - inline char as(char32 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// char result = as(value); - /// @endcode - template<> - inline char as(wchar value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// char result = as(value); - /// @endcode - template<> - inline char as(decimal value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// char result = as(value); - /// @endcode - template<> - inline char as(double value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// char result = as(value); - /// @endcode - template<> - inline char as(float value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// char result = as(value); - /// @endcode - template<> - inline char as(int16 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// char result = as(value); - /// @endcode - template<> - inline char as(int32 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// char result = as(value); - /// @endcode - template<> - inline char as(int64 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// char result = as(value); - /// @endcode - template<> - inline char as(slong value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// char result = as(value); - /// @endcode - template<> - inline char as(sbyte value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// char result = as(value); - /// @endcode - template<> - inline char as(uint16 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// char result = as(value); - /// @endcode - template<> - inline char as(uint32 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// char result = as(value); - /// @endcode - template<> - inline char as(uint64 value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// char result = as(value); - /// @endcode - template<> - inline char as(xtd::ulong value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const xtd::ustring& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(xtd::ustring& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const std::string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::string& value) { - return xtd::convert::to_char(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const std::u8string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::u8string& value) { - return xtd::convert::to_char(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const std::u16string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::u16string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const std::u32string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::u32string& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const std::wstring& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(std::wstring& value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const char* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(char* value) { - return xtd::convert::to_char(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const char8* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(char8* value) { - return xtd::convert::to_char(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const char16* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(char16* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const char32* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(char32* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(const wchar* value) { - return xtd::convert::to_char(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// char result = as(value); - /// @endcode - template<> - inline char as(wchar* value) { - return xtd::convert::to_char(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::any value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(bool value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(xtd::byte value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char8 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char16 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char32 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(wchar value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(decimal value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(double value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(float value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(int16 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(int32 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(int64 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(slong value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(sbyte value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(uint16 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(uint32 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(uint64 value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(xtd::ulong value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const xtd::ustring& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(xtd::ustring& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const std::string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const std::u8string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::u8string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const std::u16string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::u16string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const std::u32string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::u32string& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const std::wstring& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(std::wstring& value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const char* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const char8* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char8* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const char16* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char16* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const char32* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(char32* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(const wchar* value) { - return xtd::convert::to_char8(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char8 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// char8 result = as(value); - /// @endcode - template<> - inline char8 as(wchar* value) { - return xtd::convert::to_char8(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::any value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(bool value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(xtd::byte value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char value) { - return xtd::convert::to_char16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char8 value) { - return xtd::convert::to_char16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char16 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char32 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(wchar value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(decimal value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(double value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(float value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(int16 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(int32 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(int64 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(slong value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(sbyte value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(uint16 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(uint32 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(uint64 value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(xtd::ulong value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const xtd::ustring& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(xtd::ustring& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const std::string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::string& value) { - return xtd::convert::to_char16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const std::u8string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::u8string& value) { - return xtd::convert::to_char16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const std::u16string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::u16string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const std::u32string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::u32string& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const std::wstring& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(std::wstring& value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const char* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char* value) { - return xtd::convert::to_char16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const char8* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char8* value) { - return xtd::convert::to_char16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const char16* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char16* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const char32* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(char32* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(const wchar* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// char16 result = as(value); - /// @endcode - template<> - inline char16 as(wchar* value) { - return xtd::convert::to_char16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::any value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(bool value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(xtd::byte value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char value) { - return xtd::convert::to_char32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char8 value) { - return xtd::convert::to_char32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char16 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char32 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(wchar value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(decimal value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(double value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(float value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(int16 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(int32 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(int64 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(slong value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(sbyte value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(uint16 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(uint32 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(uint64 value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(xtd::ulong value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const xtd::ustring& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(xtd::ustring& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const std::string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::string& value) { - return xtd::convert::to_char32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const std::u8string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::u8string& value) { - return xtd::convert::to_char32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const std::u16string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::u16string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const std::u32string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::u32string& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const std::wstring& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(std::wstring& value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const char* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char* value) { - return xtd::convert::to_char32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const char8* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char8* value) { - return xtd::convert::to_char32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const char16* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char16* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const char32* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(char32* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(const wchar* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new char32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// char32 result = as(value); - /// @endcode - template<> - inline char32 as(wchar* value) { - return xtd::convert::to_char32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::any value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(bool value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(xtd::byte value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char value) { - return xtd::convert::to_wchar(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char8 value) { - return xtd::convert::to_wchar(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char16 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char32 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(wchar value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(decimal value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(double value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(float value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(int16 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(int32 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(int64 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(slong value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(sbyte value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(uint16 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(uint32 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(uint64 value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(xtd::ulong value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const xtd::ustring& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(xtd::ustring& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const std::string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::string& value) { - return xtd::convert::to_wchar(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const std::u8string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::u8string& value) { - return xtd::convert::to_wchar(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const std::u16string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::u16string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const std::u32string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::u32string& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const std::wstring& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(std::wstring& value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const char* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char* value) { - return xtd::convert::to_wchar(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const char8* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char8* value) { - return xtd::convert::to_wchar(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const char16* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char16* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const char32* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(char32* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(const wchar* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new wchar object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// wchar result = as(value); - /// @endcode - template<> - inline wchar as(wchar* value) { - return xtd::convert::to_wchar(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::any value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(bool value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(xtd::byte value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char value) { - return xtd::convert::to_decimal(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char8 value) { - return xtd::convert::to_decimal(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char16 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char32 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(wchar value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(decimal value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(double value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(float value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(int16 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(int32 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(int64 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(slong value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(sbyte value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(uint16 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(uint32 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(uint64 value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(xtd::ulong value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const xtd::ustring& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(xtd::ustring& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const std::string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::string& value) { - return xtd::convert::to_decimal(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const std::u8string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::u8string& value) { - return xtd::convert::to_decimal(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const std::u16string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::u16string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const std::u32string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::u32string& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const std::wstring& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(std::wstring& value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const char* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char* value) { - return xtd::convert::to_decimal(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const char8* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char8* value) { - return xtd::convert::to_decimal(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const char16* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char16* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const char32* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(char32* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(const wchar* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new decimal object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// decimal result = as(value); - /// @endcode - template<> - inline decimal as(wchar* value) { - return xtd::convert::to_decimal(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::any value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// double result = as(value); - /// @endcode - template<> - inline double as(bool value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// double result = as(value); - /// @endcode - template<> - inline double as(xtd::byte value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// double result = as(value); - /// @endcode - template<> - inline double as(char value) { - return xtd::convert::to_double(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// double result = as(value); - /// @endcode - template<> - inline double as(char8 value) { - return xtd::convert::to_double(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// double result = as(value); - /// @endcode - template<> - inline double as(char16 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// double result = as(value); - /// @endcode - template<> - inline double as(char32 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// double result = as(value); - /// @endcode - template<> - inline double as(wchar value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// double result = as(value); - /// @endcode - template<> - inline double as(decimal value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// double result = as(value); - /// @endcode - template<> - inline double as(double value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// double result = as(value); - /// @endcode - template<> - inline double as(float value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// double result = as(value); - /// @endcode - template<> - inline double as(int16 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// double result = as(value); - /// @endcode - template<> - inline double as(int32 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// double result = as(value); - /// @endcode - template<> - inline double as(int64 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// double result = as(value); - /// @endcode - template<> - inline double as(slong value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// double result = as(value); - /// @endcode - template<> - inline double as(sbyte value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// double result = as(value); - /// @endcode - template<> - inline double as(uint16 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// double result = as(value); - /// @endcode - template<> - inline double as(uint32 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// double result = as(value); - /// @endcode - template<> - inline double as(uint64 value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// double result = as(value); - /// @endcode - template<> - inline double as(xtd::ulong value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const xtd::ustring& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(xtd::ustring& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const std::string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::string& value) { - return xtd::convert::to_double(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const std::u8string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::u8string& value) { - return xtd::convert::to_double(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const std::u16string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::u16string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const std::u32string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::u32string& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const std::wstring& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(std::wstring& value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const char* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(char* value) { - return xtd::convert::to_double(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const char8* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(char8* value) { - return xtd::convert::to_double(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const char16* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(char16* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const char32* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(char32* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(const wchar* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new double object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// double result = as(value); - /// @endcode - template<> - inline double as(wchar* value) { - return xtd::convert::to_double(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::any value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// float result = as(value); - /// @endcode - template<> - inline float as(bool value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// float result = as(value); - /// @endcode - template<> - inline float as(xtd::byte value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// float result = as(value); - /// @endcode - template<> - inline float as(char value) { - return xtd::convert::to_single(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// float result = as(value); - /// @endcode - template<> - inline float as(char8 value) { - return xtd::convert::to_single(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// float result = as(value); - /// @endcode - template<> - inline float as(char16 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// float result = as(value); - /// @endcode - template<> - inline float as(char32 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// float result = as(value); - /// @endcode - template<> - inline float as(wchar value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// float result = as(value); - /// @endcode - template<> - inline float as(decimal value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// float result = as(value); - /// @endcode - template<> - inline float as(double value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// float result = as(value); - /// @endcode - template<> - inline float as(float value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// float result = as(value); - /// @endcode - template<> - inline float as(int16 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// float result = as(value); - /// @endcode - template<> - inline float as(int32 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// float result = as(value); - /// @endcode - template<> - inline float as(int64 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// float result = as(value); - /// @endcode - template<> - inline float as(slong value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// float result = as(value); - /// @endcode - template<> - inline float as(sbyte value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// float result = as(value); - /// @endcode - template<> - inline float as(uint16 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// float result = as(value); - /// @endcode - template<> - inline float as(uint32 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// float result = as(value); - /// @endcode - template<> - inline float as(uint64 value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// float result = as(value); - /// @endcode - template<> - inline float as(xtd::ulong value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const xtd::ustring& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(xtd::ustring& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const std::string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::string& value) { - return xtd::convert::to_single(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const std::u8string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::u8string& value) { - return xtd::convert::to_single(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const std::u16string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::u16string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const std::u32string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::u32string& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const std::wstring& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(std::wstring& value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const char* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(char* value) { - return xtd::convert::to_single(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const char8* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(char8* value) { - return xtd::convert::to_single(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const char16* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(char16* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const char32* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(char32* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(const wchar* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new float object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// float result = as(value); - /// @endcode - template<> - inline float as(wchar* value) { - return xtd::convert::to_single(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::any value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(bool value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(xtd::byte value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char value) { - return xtd::convert::to_int16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char8 value) { - return xtd::convert::to_int16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char16 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char32 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(wchar value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(decimal value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(double value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(float value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(int16 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(int32 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(int64 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(slong value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(sbyte value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(uint16 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(uint32 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(uint64 value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(xtd::ulong value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const xtd::ustring& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(xtd::ustring& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a int16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// int16 result = as(value, 16); - /// @endcode - template<> - inline int16 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_int16(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const std::string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::string& value) { - return xtd::convert::to_int16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const std::u8string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::u8string& value) { - return xtd::convert::to_int16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const std::u16string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::u16string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const std::u32string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::u32string& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const std::wstring& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(std::wstring& value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const char* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char* value) { - return xtd::convert::to_int16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const char8* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char8* value) { - return xtd::convert::to_int16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const char16* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char16* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const char32* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(char32* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(const wchar* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// int16 result = as(value); - /// @endcode - template<> - inline int16 as(wchar* value) { - return xtd::convert::to_int16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::any value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(bool value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(xtd::byte value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char value) { - return xtd::convert::to_int32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char8 value) { - return xtd::convert::to_int32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char16 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char32 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(wchar value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(decimal value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(double value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(float value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(int16 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(int32 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(int64 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(slong value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(sbyte value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(uint16 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(uint32 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(uint64 value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(xtd::ulong value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const xtd::ustring& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(xtd::ustring& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a int32. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// int32 result = as(value, 16); - /// @endcode - template<> - inline int32 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_int32(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const std::string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::string& value) { - return xtd::convert::to_int32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const std::u8string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::u8string& value) { - return xtd::convert::to_int32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const std::u16string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::u16string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const std::u32string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::u32string& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const std::wstring& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(std::wstring& value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const char* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char* value) { - return xtd::convert::to_int32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const char8* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char8* value) { - return xtd::convert::to_int32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const char16* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char16* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const char32* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(char32* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(const wchar* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// int32 result = as(value); - /// @endcode - template<> - inline int32 as(wchar* value) { - return xtd::convert::to_int32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::any value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(bool value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(xtd::byte value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char value) { - return xtd::convert::to_int64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char8 value) { - return xtd::convert::to_int64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char16 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char32 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(wchar value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(decimal value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(double value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(float value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(int16 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(int32 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(int64 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(slong value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(sbyte value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(uint16 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(uint32 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(uint64 value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(xtd::ulong value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const xtd::ustring& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(xtd::ustring& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a int64. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// int64 result = as(value, 16); - /// @endcode - template<> - inline int64 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_int64(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const std::string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::string& value) { - return xtd::convert::to_int64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const std::u8string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::u8string& value) { - return xtd::convert::to_int64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const std::u16string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::u16string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const std::u32string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::u32string& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const std::wstring& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(std::wstring& value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const char* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char* value) { - return xtd::convert::to_int64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const char8* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char8* value) { - return xtd::convert::to_int64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const char16* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char16* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const char32* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(char32* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(const wchar* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new int64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// int64 result = as(value); - /// @endcode - template<> - inline int64 as(wchar* value) { - return xtd::convert::to_int64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::any value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(bool value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(xtd::byte value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char value) { - return xtd::convert::to_llong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char8 value) { - return xtd::convert::to_llong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char16 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char32 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(wchar value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(decimal value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(double value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(float value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(int16 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(int32 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(int64 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(slong value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(sbyte value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(uint16 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(uint32 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(uint64 value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(xtd::ulong value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const xtd::ustring& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(xtd::ustring& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a slong. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// slong result = as(value, 16); - /// @endcode - template<> - inline slong as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_llong(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const std::string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::string& value) { - return xtd::convert::to_llong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const std::u8string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::u8string& value) { - return xtd::convert::to_llong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const std::u16string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::u16string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const std::u32string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::u32string& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const std::wstring& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(std::wstring& value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const char* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char* value) { - return xtd::convert::to_llong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const char8* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char8* value) { - return xtd::convert::to_llong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const char16* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char16* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const char32* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(char32* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(const wchar* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new slong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// slong result = as(value); - /// @endcode - template<> - inline slong as(wchar* value) { - return xtd::convert::to_llong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::any value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(bool value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(xtd::byte value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char value) { - return xtd::convert::to_sbyte(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char8 value) { - return xtd::convert::to_sbyte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char16 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char32 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(wchar value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(decimal value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(double value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(float value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(int16 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(int32 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(int64 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(slong value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(sbyte value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(uint16 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(uint32 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(uint64 value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(xtd::ulong value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const xtd::ustring& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(xtd::ustring& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a sbyte. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// sbyte result = as(value, 16); - /// @endcode - template<> - inline sbyte as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_sbyte(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const std::string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::string& value) { - return xtd::convert::to_sbyte(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const std::u8string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::u8string& value) { - return xtd::convert::to_sbyte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const std::u16string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::u16string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const std::u32string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::u32string& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const std::wstring& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(std::wstring& value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const char* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char* value) { - return xtd::convert::to_sbyte(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const char8* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char8* value) { - return xtd::convert::to_sbyte(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const char16* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char16* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const char32* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(char32* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(const wchar* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new sbyte object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// sbyte result = as(value); - /// @endcode - template<> - inline sbyte as(wchar* value) { - return xtd::convert::to_sbyte(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::any value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(bool value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(xtd::byte value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char value) { - return xtd::convert::to_uint16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char8 value) { - return xtd::convert::to_uint16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char16 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char32 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(wchar value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(decimal value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(double value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(float value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(int16 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(int32 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(int64 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(slong value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(sbyte value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(uint16 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(uint32 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(uint64 value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(xtd::ulong value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const xtd::ustring& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(xtd::ustring& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a uint16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// uint16 result = as(value, 16); - /// @endcode - template<> - inline uint16 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_uint16(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const std::string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::string& value) { - return xtd::convert::to_uint16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const std::u8string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::u8string& value) { - return xtd::convert::to_uint16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const std::u16string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::u16string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const std::u32string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::u32string& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const std::wstring& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(std::wstring& value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const char* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char* value) { - return xtd::convert::to_uint16(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const char8* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char8* value) { - return xtd::convert::to_uint16(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const char16* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char16* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const char32* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(char32* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(const wchar* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint16 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// uint16 result = as(value); - /// @endcode - template<> - inline uint16 as(wchar* value) { - return xtd::convert::to_uint16(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::any value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(bool value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(xtd::byte value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char value) { - return xtd::convert::to_uint32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char8 value) { - return xtd::convert::to_uint32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char16 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char32 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(wchar value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(decimal value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(double value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(float value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(int16 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(int32 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(int64 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(slong value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(sbyte value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(uint16 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(uint32 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(uint64 value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(xtd::ulong value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const xtd::ustring& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(xtd::ustring& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a uint32. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// uint32 result = as(value, 16); - /// @endcode - template<> - inline uint32 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_uint32(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const std::string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::string& value) { - return xtd::convert::to_uint32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const std::u8string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::u8string& value) { - return xtd::convert::to_uint32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const std::u16string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::u16string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const std::u32string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::u32string& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const std::wstring& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(std::wstring& value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const char* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char* value) { - return xtd::convert::to_uint32(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const char8* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char8* value) { - return xtd::convert::to_uint32(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const char16* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char16* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const char32* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(char32* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(const wchar* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint32 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// uint32 result = as(value); - /// @endcode - template<> - inline uint32 as(wchar* value) { - return xtd::convert::to_uint32(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::any value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(bool value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(xtd::byte value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char value) { - return xtd::convert::to_uint64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char8 value) { - return xtd::convert::to_uint64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char16 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char32 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(wchar value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(decimal value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(double value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(float value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(int16 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(int32 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(int64 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(slong value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(sbyte value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(uint16 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(uint32 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(uint64 value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(xtd::ulong value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const xtd::ustring& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(xtd::ustring& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a uint64. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// uint64 result = as(value, 16); - /// @endcode - template<> - inline uint64 as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_uint64(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const std::string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::string& value) { - return xtd::convert::to_uint64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const std::u8string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::u8string& value) { - return xtd::convert::to_uint64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const std::u16string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::u16string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const std::u32string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::u32string& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const std::wstring& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(std::wstring& value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const char* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char* value) { - return xtd::convert::to_uint64(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const char8* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char8* value) { - return xtd::convert::to_uint64(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const char16* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char16* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const char32* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(char32* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(const wchar* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new uint64 object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// uint64 result = as(value); - /// @endcode - template<> - inline uint64 as(wchar* value) { - return xtd::convert::to_uint64(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::any value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(bool value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(xtd::byte value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char value) { - return xtd::convert::to_ullong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char8 value) { - return xtd::convert::to_ullong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char16 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char32 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(wchar value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(decimal value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(double value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(float value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(int16 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(int32 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(int64 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(slong value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(sbyte value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(uint16 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(uint32 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(uint64 value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(xtd::ulong value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const xtd::ustring& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(xtd::ustring& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a xtd::ulong. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// ustring value = "0x2A"; - /// xtd::ulong result = as(value, 16); - /// @endcode - template<> - inline xtd::ulong as(const xtd::ustring& value, xtd::byte from_base) { - return xtd::convert::to_ullong(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const std::string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// string value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::string& value) { - return xtd::convert::to_ullong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const std::u8string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u8string value = u8"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::u8string& value) { - return xtd::convert::to_ullong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const std::u16string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u16string value = u"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::u16string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const std::u32string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// u32string value = U"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::u32string& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const std::wstring& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wstring value = L"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(std::wstring& value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char* value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const char* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char* value = "42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char* value) { - return xtd::convert::to_ullong(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char8* value = u8"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const char8* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8* value = u8"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char8* value) { - return xtd::convert::to_ullong(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char16* value = u"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const char16* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16* value = u"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char16* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const char32* value = U"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const char32* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32* value = U"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(char32* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const wchar* value = L"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(const wchar* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::argument_exception value does not represent a bool. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar* value = L"42"; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline xtd::ulong as(wchar* value) { - return xtd::convert::to_ullong(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::any value = true; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(std::any value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// bool value = true; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(bool value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(xtd::byte value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::byte value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(xtd::byte value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char value = 'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(char value) { - return xtd::convert::to_string(value); - } - -#if defined(__cpp_lib_char8_t) - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char8 value = u8'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(char8 value) { - return xtd::convert::to_string(value); - } -#endif - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char16 value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(char16 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// char32 value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(char32 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @exception xtd::invalid_cast_exception throws always exception. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// wchar value = u'a'; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(wchar value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// decimal value = 42.50l; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(decimal value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// double value = 42.50; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(double value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// float value = 42.50f; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(float value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(int16 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int16 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(int16 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(int32 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int32 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(int32 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42l; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(int64 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// int64 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(int64 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42ll; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(slong value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// slong value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(slong value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42ll; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(sbyte value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// sbyte value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(sbyte value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42u; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(uint16 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint16 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(uint16 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42u; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(uint32 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint32 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(uint32 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42ul; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(uint64 value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// uint64 value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(uint64 value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @return A new xtd::ulong object converted from value. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42ull; - /// xtd::ulong result = as(value); - /// @endcode - template<> - inline ustring as(xtd::ulong value) { - return xtd::convert::to_string(value); - } - - /// @brief Casts a type into another type. - /// @param value object to convert. - /// @param from_base The base of the number in value, which must be 2, 8, 10, or 16. - /// @return A new ustring object converted from value. - /// @exception xtd::argument_exception vfrom_base is not 2, 8, 10, or 16. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// xtd::ulong value = 42; - /// ustring result = as(value, 16); - /// @endcode - template<> - inline ustring as(xtd::ulong value, xtd::byte from_base) { - return xtd::convert::to_string(value, from_base); - } - - // ___________________________________________________________________________________________ - // xtd::convert_pointer specialization - - /// @brief Casts a type into another type. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const button* value = new xtd::forms::button(); - /// const control& result = as(*value); - /// @endcode - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - template - const new_type_t& as(const current_type_t& value) { - thread_local static __as_enum__::value, std::true_type, std::false_type>::type> e; - return e.convert(value); - } - - /// @brief Casts a type into another type. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// button* value = new xtd::forms::button(); - /// control& result = as(*value); - /// @endcode - /// @exception xtd::invalid_cast_exception the parameters is bad cast. - template - new_type_t& as(current_type_t& value) { - thread_local static __as_enum__::value, std::true_type, std::false_type>::type> e; - return e.convert(value); - } - - /// @brief Casts a type into another type. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// const button* value = new xtd::forms::button(); - /// const control* result = as(value); - /// @endcode - template - const new_type_t* as(const current_type_t* value) { - return xtd::convert_pointer::to_ptr(value); - } - - /// @brief Casts a type into another type. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// button* value = new xtd::forms::button(); - /// control* result = as(value); - /// @endcode - template - new_type_t* as(current_type_t* value) { - return xtd::convert_pointer::to_ptr(value); - } - - /// @brief Casts a type into another type. - /// @par Header - /// @code #include @endcode - /// @par Namespace - /// xtd - /// @par Library - /// xtd.core - /// @ingroup xtd_core - /// @par Examples - /// @code - /// std::unique_ptr