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

Use a less generic user-defined literal #38

Open
samkellett opened this issue Dec 15, 2017 · 4 comments · May be fixed by #42
Open

Use a less generic user-defined literal #38

samkellett opened this issue Dec 15, 2017 · 4 comments · May be fixed by #42

Comments

@samkellett
Copy link

Due to issues with using user-defined literals without exposing the whole namespace and interfaces generally being defined in a header, it's pretty much required to release dyno::literals into your own namespace. The problem here is that _s is far too generic, could the user-defined literal be _dyno?

@ldionne
Copy link
Owner

ldionne commented Dec 18, 2017

I acknowledge that this problem is a pain. You can also use DYNO_STRING(foo) instead of "foo"_s. Does that solve your problem, or are you set on using the UDLs but just want a less generic one?

@samkellett
Copy link
Author

samkellett commented Dec 18, 2017

I'd definitely prefer the UDL over the macro. The macro feels like a significant step backwards considering how cutting edge this library is.

Seeing as the macro actually has similar namespacing issues (worse, of course, due to the global namespace pollution not being opt-in) which are solved with a C-style DYNO_ prefix, I think it would make sense for the UDLs to follow the same approach. At least until the language is fixed in this respect.

@ldionne
Copy link
Owner

ldionne commented Jan 1, 2018

Would you suggest the dyno::literals namespace be dropped in that case?

I've made the change of _s to _dyno on a branch locally and it's a trivial change for me to make. The only thing keeping me from pushing it is that it's uglier to write "some_method"_dyno than "some_method"_s.

@samkellett
Copy link
Author

Would you suggest the dyno::literals namespace be dropped in that case?

no because if the UDL is defined inside only the dyno namespace the user is required to do a using namespace dyno in a header file to be able to create a public interface.

i don't think _dyno is that ugly tbh.

@ldionne ldionne linked a pull request Jan 6, 2018 that will close this issue
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 a pull request may close this issue.

2 participants