C
Christopher
I am getting an odd compiler error:
'Pass:perator =' : cannot access private member declared in class
'Pass'
It is speaking as if I am trying to assign a Pass object to Pass
another object, but I am trying to assign a reference to another
reference.
//----------------------------------------------------------------------------
class Pass
{
public:
/** Only a Technique should construct a Pass */
friend class Technique;
~Pass();
// Snip
private:
/**
* Constructor
*
* Only a Technique should construct a Pass
**/
Pass(ID3D10EffectPass * pass);
/* No copy not allowed */
Pass(const Pass & rhs);
/** No assignment allowed */
Pass & operator = (const Pass & rhs);
// SNIP
};
class PolygonSet
{
// SNIP
protected:
// SNIP
struct PassInfo
{
PassInfo(Pass & pass, const std::vector<unsigned> &
vertexBufferIndices, ID3D10InputLayout * inputLayout);
PassInfo(const PassInfo & rhs);
PassInfo & operator = (const PassInfo & rhs);
Pass & m_pass; // A
single pass from a technique
std::vector<unsigned> m_vertexBufferIndices; // Which buffers
provide the data required for the pass
ID3D10InputLayout * m_inputLayout; // Input layout
used for a specific pass
};
};
//------------------------------------------------------------------------------------------
PolygonSet:assInfo & PolygonSet:assInfo:perator = (const
PassInfo & rhs)
{
m_pass =
rhs.m_pass; // PROBLEM HERE
m_vertexBufferIndices = rhs.m_vertexBufferIndices;
m_inputLayout = rhs.m_inputLayout;
return *this;
}
I don't understand why it is not letting me assign a reference to
another reference. I don't ever have problems doing that in a
constructor's initialization list. What's going on here?
'Pass:perator =' : cannot access private member declared in class
'Pass'
It is speaking as if I am trying to assign a Pass object to Pass
another object, but I am trying to assign a reference to another
reference.
//----------------------------------------------------------------------------
class Pass
{
public:
/** Only a Technique should construct a Pass */
friend class Technique;
~Pass();
// Snip
private:
/**
* Constructor
*
* Only a Technique should construct a Pass
**/
Pass(ID3D10EffectPass * pass);
/* No copy not allowed */
Pass(const Pass & rhs);
/** No assignment allowed */
Pass & operator = (const Pass & rhs);
// SNIP
};
class PolygonSet
{
// SNIP
protected:
// SNIP
struct PassInfo
{
PassInfo(Pass & pass, const std::vector<unsigned> &
vertexBufferIndices, ID3D10InputLayout * inputLayout);
PassInfo(const PassInfo & rhs);
PassInfo & operator = (const PassInfo & rhs);
Pass & m_pass; // A
single pass from a technique
std::vector<unsigned> m_vertexBufferIndices; // Which buffers
provide the data required for the pass
ID3D10InputLayout * m_inputLayout; // Input layout
used for a specific pass
};
};
//------------------------------------------------------------------------------------------
PolygonSet:assInfo & PolygonSet:assInfo:perator = (const
PassInfo & rhs)
{
m_pass =
rhs.m_pass; // PROBLEM HERE
m_vertexBufferIndices = rhs.m_vertexBufferIndices;
m_inputLayout = rhs.m_inputLayout;
return *this;
}
I don't understand why it is not letting me assign a reference to
another reference. I don't ever have problems doing that in a
constructor's initialization list. What's going on here?