From 4e7ae339d6d2e311c510186c598aa2b2b0582f53 Mon Sep 17 00:00:00 2001 From: Maya Warrier Date: Sun, 7 May 2023 00:34:58 -0400 Subject: [PATCH 1/2] Implement intellisense fix --- .gitignore | 18 ++++++++++++++++ include/fast_float/fast_float.h | 32 ++--------------------------- include/fast_float/float_common.h | 34 +++++++++++++++++++++++++++++++ include/fast_float/parse_number.h | 1 + 4 files changed, 55 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 1566557..c9e8138 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,21 @@ build/* Testing/* .cache/ compile_commands.json + +# Visual Studio +.vs/ +Debug/ +Release/ +*.sln +*.vcxproj +*.vcxproj.filters +*.vcxproj.user +*.psess +*.vspx +*.vsp +*.diagsession +*.hint + +# VS CMake +/out/ +/CMakeSettings.json diff --git a/include/fast_float/fast_float.h b/include/fast_float/fast_float.h index 1cc25f4..04efa87 100644 --- a/include/fast_float/fast_float.h +++ b/include/fast_float/fast_float.h @@ -1,38 +1,10 @@ + #ifndef FASTFLOAT_FAST_FLOAT_H #define FASTFLOAT_FAST_FLOAT_H -#include - -#include "constexpr_feature_detect.h" +#include "float_common.h" namespace fast_float { -enum chars_format { - scientific = 1<<0, - fixed = 1<<2, - hex = 1<<3, - general = fixed | scientific -}; - -template -struct from_chars_result_t { - UC const * ptr; - std::errc ec; -}; -using from_chars_result = from_chars_result_t; - -template -struct parse_options_t { - constexpr explicit parse_options_t(chars_format fmt = chars_format::general, - UC dot = UC('.')) - : format(fmt), decimal_point(dot) {} - - /** Which number formats are accepted */ - chars_format format; - /** The character used as decimal point */ - UC decimal_point; -}; -using parse_options = parse_options_t; - /** * This function parses the character sequence [first,last) for a number. It parses floating-point numbers expecting * a locale-indepent format equivalent to what is used by std::strtod in the default ("C") locale. diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 6901d7c..3439600 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -6,6 +6,40 @@ #include #include #include +#include + +#include "constexpr_feature_detect.h" + +namespace fast_float { + +enum chars_format { + scientific = 1 << 0, + fixed = 1 << 2, + hex = 1 << 3, + general = fixed | scientific +}; + +template +struct from_chars_result_t { + UC const* ptr; + std::errc ec; +}; +using from_chars_result = from_chars_result_t; + +template +struct parse_options_t { + constexpr explicit parse_options_t(chars_format fmt = chars_format::general, + UC dot = UC('.')) + : format(fmt), decimal_point(dot) {} + + /** Which number formats are accepted */ + chars_format format; + /** The character used as decimal point */ + UC decimal_point; +}; +using parse_options = parse_options_t; + +} #if FASTFLOAT_HAS_BIT_CAST #include diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index 726d761..4541d70 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -4,6 +4,7 @@ #include "ascii_number.h" #include "decimal_to_binary.h" #include "digit_comparison.h" +#include "float_common.h" #include #include From db7991a612de88d3eced98e1ee6752b600523ff1 Mon Sep 17 00:00:00 2001 From: Maya Warrier Date: Sun, 7 May 2023 17:04:02 -0400 Subject: [PATCH 2/2] amalmagate.py header inclusion order --- script/amalgamate.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/script/amalgamate.py b/script/amalgamate.py index c0f078d..6a25459 100644 --- a/script/amalgamate.py +++ b/script/amalgamate.py @@ -31,9 +31,8 @@ for filename in ['LICENSE-MIT', 'LICENSE-APACHE']: processed_files[filename] = text # code -for filename in [ 'constexpr_feature_detect.h', 'fast_float.h', 'float_common.h', 'ascii_number.h', - 'fast_table.h', 'decimal_to_binary.h', 'bigint.h', - 'ascii_number.h', 'digit_comparison.h', 'parse_number.h']: +for filename in [ 'constexpr_feature_detect.h', 'float_common.h', 'fast_float.h', 'ascii_number.h', + 'fast_table.h', 'decimal_to_binary.h', 'bigint.h', 'digit_comparison.h', 'parse_number.h']: with open('include/fast_float/' + filename, encoding='utf8') as f: text = '' for line in f: @@ -76,11 +75,10 @@ text = ''.join([ processed_files['AUTHORS'], processed_files['CONTRIBUTORS'], *license_content(args.license), processed_files['constexpr_feature_detect.h'], - processed_files['fast_float.h'], processed_files['float_common.h'], + processed_files['float_common.h'], processed_files['fast_float.h'], processed_files['ascii_number.h'], processed_files['fast_table.h'], processed_files['decimal_to_binary.h'], processed_files['bigint.h'], - processed_files['ascii_number.h'], processed_files['digit_comparison.h'], - processed_files['parse_number.h']]) + processed_files['digit_comparison.h'], processed_files['parse_number.h']]) if args.output: with open(args.output, 'wt', encoding='utf8') as f: