Skip to content
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

Make operator / a friend of string_path #119

Merged

Conversation

ashtum
Copy link
Collaborator

@ashtum ashtum commented Dec 5, 2023

No description provided.

@ashtum ashtum changed the title Add operator / for string path and string Add operator / for string_path and string Dec 5, 2023
@ashtum
Copy link
Collaborator Author

ashtum commented Dec 5, 2023

@pdimov, Upon further consideration, I made the operator/ overload a friend of string_path so that it can be implicitly constructed from string and char types when needed. With that, we don't need multiple overloads (the first commit in this PR). Is this the preferred approach?

@pdimov
Copy link
Member

pdimov commented Dec 5, 2023

What are we trying to fix here? #24 and http://trac.cpp.al/trac10/ticket/12466?

@ashtum
Copy link
Collaborator Author

ashtum commented Dec 5, 2023

What are we trying to fix here? #24 and http://trac.cpp.al/trac10/ticket/12466?

Yes.

@pdimov
Copy link
Member

pdimov commented Dec 5, 2023

This is the preferred approach, yes. But it looks like we are missing a test for p1 / p2 with p1 and p2 both being paths.

@ashtum ashtum force-pushed the add-operator-/-for-string_path-and-string branch from 872938a to 6b16249 Compare December 5, 2023 15:40
@ashtum ashtum changed the title Add operator / for string_path and string Make operator / a friend of string_path Dec 5, 2023
Comment on lines +1029 to +1036
{
path p = path(T("key1")) / path(T("key2.key3"));
BOOST_TEST(pt.get<int>(p, 0) == 1);
}
{
path p = path(T("key1.key2")) / path(T("key3"));
BOOST_TEST(pt.get<int>(p, 0) == 1);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it looks like we are missing a test for p1 / p2 with p1 and p2 both being paths.

@pdimov, Addressed.

@ashtum ashtum requested a review from pdimov December 5, 2023 16:32
@pdimov pdimov merged commit 8080ecd into boostorg:develop Dec 5, 2023
55 checks passed
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.

None yet

2 participants