Skip to content

Instantly share code, notes, and snippets.

@cheako
Created November 6, 2018 17:28
Show Gist options
  • Save cheako/2dfbd9ab1266e451e263747ced2c5f42 to your computer and use it in GitHub Desktop.
Save cheako/2dfbd9ab1266e451e263747ced2c5f42 to your computer and use it in GitHub Desktop.
Strange error from VSCode 1.23.1.
#include <Demo.hpp>
struct Class::Item
{
int a;
};
Class::Class() : m_item(new Class::Item()){};
/* _new_:
* a value of type "Class::Item *" cannot be used to initialize an entity of type "std::unique_ptr<Class::Item, std::default_delete<Class::Item>> *"
Class::Item::Class::Item()
*
* +2 overloads
*/
#include <memory>
class Class
{
Class();
private:
struct Item;
std::unique_ptr<Item> *m_item;
};
Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T16:04:28.220Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture ia32
@cheako
Copy link
Author

cheako commented Nov 6, 2018

This is because of an extra * after unique_ptr<>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment