-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Variant initialization improvisation (suggestion) #600
Comments
Hello @amutamil, thank you for your feedback! The implementation code you show as it could be isn't valid C++. The second pair of angle brackets is not allowed. I agree that by default, variant constructs the first type. However, this is an implementation detail of Andreas |
Hello Andres, |
Hello @amutamil, well, the issue is that C++ Insights uses LLVM/Clang. You need a bit of knowledge there and then find the right entry point for the transformation in C++ Insights. The latter is complex as there is more than just a bare variable declaration. One can also create temporary objects. As I said above, I don't think the feature is worth the effort. Andreas |
okay thanks :) Amutamil E |
when variant is declared without initialisation default constructor of variant construct with first data type mentioned. so can we include this in .
for example currently
variant <int, string> v;
is compiled tostd::variant<int, std::basic_string<char> > v = std::variant<int, std::basic_string<char> >();
.but can we implement something like
std::variant <int, std::basic_string<char> > v = std::variant<int, std::basic_string<char> ><int, 0>();
which is more similar to MSVC compilationThe text was updated successfully, but these errors were encountered: