|
-
July 20th, 2011, 12:33 PM
#1
move constructor is ignored?
Hi,
I've just written my first move constructors and move assignment operators. They seem to compile just fine, but when I try to set a breakpoint inside them, the debugger acts like they don't even exist. It acts like the source code for them is a comment, such that the breakpoints move to the first lines of code after them. This is with VS 2010.
I can't post the exact code but it looks something like this:
Code:
// In .h file
class OuterClass
{
class InnerClass;
// Other stuff...
};
// In .cpp file
class OuterClass::InnerClass
{
public:
// Copy constructor
InnerClass(InnerClass const & rhs)
:
m_WrapperAroundHugeMemberDataStructure(StaticConstIntegerId)
{
*this = rhs;
}
// Move constructor
InnerClass(InnerClass && rhs)
:
m_WrapperAroundHugeMemberDataStructure(StaticConstIntegerId)
{
m_WrapperAroundHugeMemberDataStructure.SwapHugeData(&rhs.m_WrapperAroundHugeMemberDataStructure);
}
// Destructor
~InnerClass(void) {}
// Other stuff...
};
When I set a breakpoint anywhere in the move constructor, the breakpoint jumps down to the destructor.
The same thing happens with the move assignment operator in this class. I have another class with a move constructor and move assignment which has the same problem, and it is also an inner class.
Am I doing anything obviously wrong here? Do move constructors have some subtlety when used with inner classes?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|