Skip to content

Make Boost regex a private dependency #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

pthom
Copy link

@pthom pthom commented Jan 28, 2025

Hi,

This PR brings two modifications:

  1. use "%zu" in printf specifiers for vector sizes

  2. make boost/regex a private dependency
    (i.e. it can be included in TextEditor.cpp, but not in TextEditor.h which is part of the API).

The reason for this is to avoid that users would need to add vendor/boost/regex to their include path (when it is only used by TextEditor.cpp).

  • Only TextEditor.cpp will include boost/regex.hpp (private dependency)
  • We use a partial pImpl: RegexList is declared inside TextEditor.h, and implemented inside TextEditor.cpp
  • We use a shared_ptr instead of unique_ptr , because we want to keep TextEditor copyable (otherwise, this would break the API for existing users)

Cheers,

pthom added 2 commits January 28, 2025 16:52
- Do not include boost/regex.hpp in the main api file (TextEditor.h), so that users do not need to add vendor/boost/regex to their include path
- Only TextEditor.cpp will include boost/regex.hpp (private dependency)
- We use a partial pImpl: RegexList is declared inside TextEditor.h, and implemented inside TextEditor.cpp
- We use a shared_ptr<RegexList> instead of unique_ptr , because we want to keep TextEditor copyable (otherwise, this would break the API for existing users)
@santaclose santaclose merged commit cd9090d into santaclose:master Jan 28, 2025
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