Enhance integer parsing and formatting by adding modern octal support#1278
Enhance integer parsing and formatting by adding modern octal support#1278MacroModel wants to merge 1 commit into
Conversation
- Updated various integer-related functions and structures to include a `modern_octal` flag, allowing for improved handling of octal representations. - Modified parsing and printing functions to accommodate the new flag, ensuring compatibility with existing functionality while enhancing octal output. - Adjusted related functions across multiple files, including `chrono.h`, `impl.h`, `ordinal.h`, `percentage.h`, and others, to support the modern octal feature. - Ensured that the changes maintain backward compatibility and do not disrupt existing functionality.
|
@trcrsired 你自己想一个名字区分0o/0O和0我目前只是加了template,你得手动oct<default,default,true>才能用,默认全部都还是0,你自己取一个名字就行 |
|
modern_octal is a bad name. If you want to push this, it should be by default 0o1234. then have a octal_deprecated as the proposal said. Also 0x should NEVER be parsed by default. |
default: oct (mnp::oct and mnp::oct_get): 0777 same as current c/cpp standard (c++20 -> c++23), and nowadays all compiler switch cpp20 by default. keep oct and oct_get func name as default c/cpp octal to ensure the compatibility for old (default) c/cpp . btw i never say prefix should be parsed by default. what you havent achieved: 1. hexfloat parser: scan 1.0ep3 by default, or 0x1.0ep3 by switch the boolean in func template. 2. float parser: i highly recommand using the fast_float algorithm |
|
also im not currently providing a specific mnp func, i only offer the templatere as a switching control. after merging, you can name it yourself |
modern_octalflag, allowing for improved handling of octal representations.chrono.h,impl.h,ordinal.h,percentage.h, and others, to support the modern octal feature.