-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Fixed issue #167 - removed operator ValueType() condition for VS2015 #188
Conversation
This causes VS2015 to not be able to type cast into a
Putting back the condition fixes it. I'm not sure about operator<< ambiguity. Can you post the code that makes it break? |
I cannot recall right now... I'll have a look. |
@Cleroth, the change originated a post by @twelsby (#167 (comment)) who also made this PR. As I cannot test MSVC myself, I do not know whether this change is still needed. |
Unfortunately this 9de14a4 (the Compiling https://github.com/sony/nmos-cpp/blob/master/Development/third_party/nlohmann/json-validator.cpp gives this:
With the line
not #ifdefed out in Visual Studio 2019 16.5 ( So I propose this patch:
|
I agree something like the change @aholzinger suggests is required. I suggest the preprocessor condition two lines down should also be revisited, since the |
#167 (comment) includes some minimal code that failed to compile with VS2015. I tested this myself (with Version 14.0.25431.01 Update 3) and it compiles fine whether or not the outer On the other hand, I found that similar code using And that applies in VS 2019 (Version 16.5.0) also. Demo: https://godbolt.org/z/vaksWb @aholzinger, probably these issues with VS 2019 need to be raised as a new issue, maybe referring to this, in order to get any traction. |
@garethsb-sony, I just searched to find this comment/issue and it was hard to find, so I guess you're right. You made the example also, do you want to add a new issue? |
Removed the condition
and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
from theoperator ValueType() const
template for VS2015 only. This is what has been causing AppVeyor build errors since it was introduced in commit 457bfc2 to address a problem with implicit conversion to strings (issue #144). While this worked for gcc it causesoperator<<
ambiguity under VS2015 for reasons that are still unclear (to me, but may be obvious to others). It would be more satisfying to know why this caused VS2015 to break but not gcc but at least it solves the problem. The fix for implicit conversion to strings still works after this change.