Skip to content

Enhance integer parsing and formatting by adding modern octal support#1278

Open
MacroModel wants to merge 1 commit into
cppfastio:nextfrom
MacroModel:next
Open

Enhance integer parsing and formatting by adding modern octal support#1278
MacroModel wants to merge 1 commit into
cppfastio:nextfrom
MacroModel:next

Conversation

@MacroModel
Copy link
Copy Markdown
Collaborator

  • 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.

- 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.
@MacroModel
Copy link
Copy Markdown
Collaborator Author

@trcrsired 你自己想一个名字区分0o/0O和0我目前只是加了template,你得手动oct<default,default,true>才能用,默认全部都还是0,你自己取一个名字就行

@MacroModel
Copy link
Copy Markdown
Collaborator Author

@trcrsired
Copy link
Copy Markdown
Member

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.

@MacroModel
Copy link
Copy Markdown
Collaborator Author

MacroModel commented Jun 2, 2026

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.
c2y_octal (mnp::oct_c2y and mnp::oct_c2y_get) :0o777 c2y or cpp26 (inherited from c2y).

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

@MacroModel
Copy link
Copy Markdown
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants