I am currently refactoring some old code to meet C++14 standards of correctness and something weird is happening.
This error is so far unique and does not appear in the rest of the code. I've obfuscated the actual types because they aren't important.
Prior to the refactor, the following code worked just fine:
namespace N {
class A {
public:
A(B* blah) : _blah(blah); //class A owns the instance of class B.
~A() { delete m_blah; m_blah = nullptr; }
//...Lots more code.
private:
B* m_blah;
};
}
I changed any necessary ownership-based pointers to their respective smart pointers:
#include <memory>
namespace N {
class A {
public:
A(std::unique_ptr<B> blah);
~A() { /* DO NOTHING */ }
private:
std::unique_ptr<B> m_blah;
};
}
This no longer works. Intellisense reports an error:
"Error: namespace "N::std" has no member unique_ptr"
in the constructor declaration. (But NOT the declaration of m_blah
)
....What? Why is the standard library namespace being pulled into N?!
Versioning Info:
- VS2015 Community Edition (RTM) Version 14.0.23107.0 D14REL
- Developer Command Prompt reports cl version: Compiler Version 19.00.23026