azure-sdk-for-cpp
azure-sdk-for-cpp copied to clipboard
Telemetry policy to send what C++ language version is used when customers are building with our SDK
It can be done, if the __cplusplus would be expanded in .hpp, NOT in .cpp - that would show the value of the macro when our sdk is consumed, not when it is built.
That could happen in the private constructor for the telemetry policy.
Illustration: https://godbolt.org/z/5d8P7qq89 (try modifying the value of -std=c++17)
#include <iostream>
// AzureSDK.hpp
namespace Azure {
namespace _internal {
void UseAzureSDKInternal(long cppver);
}
void UseAzureSDK() { _internal::UseAzureSDKInternal(__cplusplus); }
}
// AzureSDK.cpp
//#include <AzureSDK.hpp>
void Azure::_internal::UseAzureSDKInternal(long cppver)
{
std::cout << cppver;
}
// Customer's code:
//#include <AzureSDK.hpp>
int main ()
{
Azure::UseAzureSDK();
}
Thank you for your feedback. Tagging and routing to the team member best able to assist.