Android Studio C ++ native compiler does not understand smart pointer promotion

My Android Studio built-in compiler is showing me an error when passing a unique_ptr

derived class to a function expecting a unique_ptr

parent class. But the code compiles as I expected.

enter image description here

The error message from the code snippet above:

Parameter type mismatch: Class 'std::unique_ptr<B>' is not compatible with class 'std::unique_ptr<A>'

      

I think this is a bug related to Android Studio? I was wondering if there are options for this error checking, nothing to find

EDIT: Please note that this code compiles without compiler errors (the bug I quoted is Android Studio's real-time authentication). You can check the code here: https://ideone.com/xlUsKs

+3
c ++ android android-studio


source to share


No one has answered this question yet

Check out similar questions:

332
Android Studio does not see devices
190
RAII and smart pointers in C ++
48
unique_ptr for a derived class as an argument to a function that maps unique_ptr to the base class
3
VS2010's implementation of bind doesn't support move-only types?
3
How can I store a list of smart pointers inside a C ++ class?
2
Android Studio: Gradle does not find HoloEverywhere
2
using unique_ptr with boost python - boost :: shared_ptr works, but unique_ptr doesnt
2
Compiler error passing unique_ptr <derived> for a function that takes a unique_ptr <base href = "" target = _top / "> parameter
1
Android studio glass and androids taste compilation of false positives
1
Android Studio shows compiler errors for no reason



All Articles
Loading...
X
Show
Funny
Dev
Pics