xtd 0.2.0
Loading...
Searching...
No Matches
__as_double.hpp
Go to the documentation of this file.
1
3#pragma once
4
6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
8#endif
10
11#define __XTD_STD_INTERNAL__
12#include "__xtd_std_version.hpp"
13#undef __XTD_STD_INTERNAL__
14
16namespace xtd {
35 template<>
36 inline double as<double>(std::any value) {
37 return xtd::convert::to_double(value);
38 }
39
57 template<>
58 inline double as<double>(bool value) {
59 return xtd::convert::to_double(value);
60 }
61
79 template<>
80 inline double as<double>(xtd::byte value) {
81 return xtd::convert::to_double(value);
82 }
83
102 template<>
103 inline double as<double>(char value) {
104 return xtd::convert::to_double(value);
105 }
106
107#if defined(__xtd__cpp_lib_char8_t)
126 template<>
127 inline double as<double>(char8 value) {
128 return xtd::convert::to_double(value);
129 }
130#endif
131
150 template<>
151 inline double as<double>(char16 value) {
152 return xtd::convert::to_double(value);
153 }
154
173 template<>
174 inline double as<double>(char32 value) {
175 return xtd::convert::to_double(value);
176 }
177
196 template<>
197 inline double as<double>(wchar value) {
198 return xtd::convert::to_double(value);
199 }
200
218 template<>
219 inline double as<double>(decimal value) {
220 return xtd::convert::to_double(value);
221 }
222
240 template<>
241 inline double as<double>(double value) {
242 return xtd::convert::to_double(value);
243 }
244
262 template<>
263 inline double as<double>(float value) {
264 return xtd::convert::to_double(value);
265 }
266
284 template<>
285 inline double as<double>(int16 value) {
286 return xtd::convert::to_double(value);
287 }
288
306 template<>
307 inline double as<double>(int32 value) {
308 return xtd::convert::to_double(value);
309 }
310
328 template<>
329 inline double as<double>(int64 value) {
330 return xtd::convert::to_double(value);
331 }
332
350 template<>
351 inline double as<double>(slong value) {
352 return xtd::convert::to_double(value);
353 }
354
372 template<>
373 inline double as<double>(sbyte value) {
374 return xtd::convert::to_double(value);
375 }
376
394 template<>
395 inline double as<double>(uint16 value) {
396 return xtd::convert::to_double(value);
397 }
398
416 template<>
417 inline double as<double>(uint32 value) {
418 return xtd::convert::to_double(value);
419 }
420
438 template<>
439 inline double as<double>(uint64 value) {
440 return xtd::convert::to_double(value);
441 }
442
460 template<>
461 inline double as<double>(xtd::ulong value) {
462 return xtd::convert::to_double(value);
463 }
464
483 template<>
484 inline double as<double>(const xtd::string& value) {
485 return xtd::convert::to_double(value);
486 }
487
506 template<>
507 inline double as<double>(xtd::string& value) {
508 return xtd::convert::to_double(value);
509 }
510
529 template<>
530 inline double as<double>(const std::string& value) {
531 return xtd::convert::to_double(value);
532 }
533
552 template<>
553 inline double as<double>(std::string& value) {
554 return xtd::convert::to_double(value);
555 }
556
557#if defined(__xtd__cpp_lib_char8_t)
576 template<>
577 inline double as<double>(const std::u8string& value) {
578 return xtd::convert::to_double(value);
579 }
580
599 template<>
600 inline double as<double>(std::u8string& value) {
601 return xtd::convert::to_double(value);
602 }
603#endif
604
623 template<>
624 inline double as<double>(const std::u16string& value) {
625 return xtd::convert::to_double(value);
626 }
627
646 template<>
647 inline double as<double>(std::u16string& value) {
648 return xtd::convert::to_double(value);
649 }
650
669 template<>
670 inline double as<double>(const std::u32string& value) {
671 return xtd::convert::to_double(value);
672 }
673
692 template<>
693 inline double as<double>(std::u32string& value) {
694 return xtd::convert::to_double(value);
695 }
696
715 template<>
716 inline double as<double>(const std::wstring& value) {
717 return xtd::convert::to_double(value);
718 }
719
738 template<>
739 inline double as<double>(std::wstring& value) {
740 return xtd::convert::to_double(value);
741 }
742
761 template<>
762 inline double as<double>(const char* value) {
763 return xtd::convert::to_double(value);
764 }
765
784 template<>
785 inline double as<double>(char* value) {
786 return xtd::convert::to_double(value);
787 }
788
789#if defined(__xtd__cpp_lib_char8_t)
808 template<>
809 inline double as<double>(const char8* value) {
810 return xtd::convert::to_double(value);
811 }
812
831 template<>
832 inline double as<double>(char8* value) {
833 return xtd::convert::to_double(value);
834 }
835#endif
836
855 template<>
856 inline double as<double>(const char16* value) {
857 return xtd::convert::to_double(value);
858 }
859
878 template<>
879 inline double as<double>(char16* value) {
880 return xtd::convert::to_double(value);
881 }
882
901 template<>
902 inline double as<double>(const char32* value) {
903 return xtd::convert::to_double(value);
904 }
905
924 template<>
925 inline double as<double>(char32* value) {
926 return xtd::convert::to_double(value);
927 }
928
947 template<>
948 inline double as<double>(const wchar* value) {
949 return xtd::convert::to_double(value);
950 }
951
970 template<>
971 inline double as<double>(wchar* value) {
972 return xtd::convert::to_double(value);
973 }
974}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.hpp:79
static double to_double(std::any value)
Convert std::any to double.
int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:27
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.hpp:27
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.hpp:27
double as< double >(std::any value)
Casts a type into another type.
Definition __as_double.hpp:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10