-
Notifications
You must be signed in to change notification settings - Fork 98
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
Can't write tag_invoke for ::boost::uuids::uuid - build failed! #1063
Comments
In your case, it means you need to put it into the namespace |
Thank you. Unfortunally i cant use contextual conversion cos i call value_to inside fold expression with variadic template (inside parsing my meta methods ) something like this
So i simply don't know what type of argument will be at this point. It may be int, string uuid or anything else. So in case of contextual conversion i must to implement contexts for all types including fundamental - but is obviously irrational. Besides.. we already have alias of boost::uuids::uuid inside our big project - for us it's looks like our_ns::uuid. So for now i just writed tag_invoke for uuid inside "our_ns" namespace - and it's work for me ! |
You don't need to implement contextual conversions for every type. It falls back to contextless conversions, if there's no contextual overload. And you can even combine contextual conversions for different types. See this section: https://www.boost.org/doc/libs/1_87_0/libs/json/doc/html/json/conversion/contextual_conversions.html#json.conversion.contextual_conversions.combining_contexts. In the example two types use different contexts, and a third type ( Also, I have a suspicion that putting the overload into the namespace of the alias works due to an MSVC non-conformance (essentialy, a bug). |
How to write tag_invoke for uuid? - it seems boost.json represents uuid as something like vector, so build failed
Code:
Errors:
MSVC 2022 Version 17.11.4
boost 86
The text was updated successfully, but these errors were encountered: