Skip to content

Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time#267

Closed
andreasbuhr wants to merge 1 commit intoboostorg:developfrom
andreasbuhr:introduce_define_disable_trace
Closed

Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time#267
andreasbuhr wants to merge 1 commit intoboostorg:developfrom
andreasbuhr:introduce_define_disable_trace

Conversation

@andreasbuhr
Copy link
Contributor

The trace feature doubles the compile time, even if never used. This patch introduces the preprocessor define BOOST_PARSER_DISABLE_TRACE to deactivate this feature at compile time.

@tzlaine
Copy link
Collaborator

tzlaine commented Nov 1, 2025

I'd be much happier merging this if it had a proper place in config.hpp, and had associated documentation. I think this is reasonable, so I'll do it eventually, but it's pretty low priority for me.

@andreasbuhr
Copy link
Contributor Author

Great. I'll improve this Pull Request over time and rebase it on develop from time to time. Expect it to be polished in mid of January.

@andreasbuhr andreasbuhr changed the title Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time WIP: Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time Dec 10, 2025
@andreasbuhr andreasbuhr force-pushed the introduce_define_disable_trace branch 2 times, most recently from 798e5dc to 15a5eab Compare December 12, 2025 07:42
@andreasbuhr andreasbuhr marked this pull request as draft December 12, 2025 21:19
@andreasbuhr andreasbuhr force-pushed the introduce_define_disable_trace branch 3 times, most recently from 42624bc to 6848ed4 Compare January 26, 2026 14:14
@andreasbuhr andreasbuhr marked this pull request as ready for review January 26, 2026 14:14
@andreasbuhr andreasbuhr changed the title WIP: Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time Jan 26, 2026
…e time.

The trace feature doubles the compile time, even if never used.
This patch introduces the preprocessor define BOOST_PARSER_DISABLE_TRACE
to deactivate this feature at compile time.
@andreasbuhr andreasbuhr force-pushed the introduce_define_disable_trace branch from 6848ed4 to 399eb5b Compare February 3, 2026 10:29
@andreasbuhr
Copy link
Contributor Author

Rebased on develop.
This is ready to be merged from my perspective. If you have suggestions to improve this, let me know.

@tzlaine
Copy link
Collaborator

tzlaine commented Feb 14, 2026

I'm not going to commit this as-is, because of nits about the way you wrote the change; the semantics seem fine. It was quicker to just change it to my liking than to describe what I wanted changed. See your modified commit on the https://github.com/boostorg/parser/tree/introduce_define_disable_trace branch if you're curious. The tl;dr is I introduced a "private"/undocumented macro that I hang everything off of, and define it based on whether the user defines the user-facing one. This is the pattern for all macros in all my Boost libs. One advantage of doing this is that you can treat the macro as a constant, and don't need #ifs in as many places, which IMO improves readability.

Superceded by PR #314 .

@tzlaine tzlaine closed this Feb 14, 2026
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

Comments