azure-sdk-for-cpp icon indicating copy to clipboard operation
azure-sdk-for-cpp copied to clipboard

Getting issue in nullable.hpp file while integrating the azure sdk for cpp into our application

Open yashshah-22 opened this issue 1 year ago • 5 comments

Query/Question Getting issue Error C2556 'int64_t *Azure::Nullable<int64_t>::operator ->(void) const': overloaded function differs only by return type from 'const int64_t *Azure::Nullable<int64_t>::operator ->(void) const' (compiling source file login.cpp) in file nullable.hpp while integrating azure sdk into our project.I have not made any changes in the file still getting the errors.

In login.cpp I have used header files #include<azure/identity.hpp> #include<azure/core.hpp>

Why is this not a Bug or a feature Request?

The problem could be resolved by adjusting the implementation to avoid overloading based only on return type. This typically involves refactoring the function signatures or ensuring that only one version of operator-> exists.

Setup (please complete the following information if applicable):

  • OS: Windows
  • IDE : Visual Studio Community 2015

yashshah-22 avatar May 17 '24 09:05 yashshah-22

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] avatar May 17 '24 09:05 github-actions[bot]

I'm a tad confused. Based on my reading of the source code, there are two different declarations of the operator-> method.

At line 281, we have:

  constexpr const T* operator->() const { return std::addressof(m_value); }

which applies to const Nullable values.

At line 291 we have:

  constexpr T* operator->() { return std::addressof(m_value); }

which applies to Nullable values (mutable or non-const). So there shouldn't be any ambiguities in the implementation.

Your bug report doesn't indicate which line is upsetting the compiler, so it's hard to fully understand what is causing challenges.

If it is possible to build a stand-alone reproduction of the problem, it would help a great deal in understanding the problem.

I did notice that you are using a rather old version of Visual Studio community edition (2015). We don't include this version of the compiler in our tests because it is a fairly old version of the compiler.

Would it be possible to try this on a newer version of Visual Studio? There have been many language compliance related changes made to Visual Studio over the past 8 years which may be affecting your code.

LarryOsterman avatar May 17 '24 16:05 LarryOsterman

Yes , I will try with Visual Studio 2022 and let you know . Thanks!!!!!

yashshah-22 avatar May 20 '24 05:05 yashshah-22

Hi @yashshah-22. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar May 21 '24 20:05 github-actions[bot]

@yashshah-22, apparently our bot didn't notice you had replied - feel free to ignore that :).

Looking forward to your update.

LarryOsterman avatar May 22 '24 16:05 LarryOsterman

Hi @yashshah-22, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar May 29 '24 21:05 github-actions[bot]