This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hello,
In c++, suppose I define a template class
typedef unsigned long tWord32; ... template<class T, tWord32 size>
class cBuffer { public:
T mBuff[size]; };
then declare a global,
cBuffer<tWord32, 512> longBuff;
Is &(longBuff.mBuff) known at link-time?
[...] Now suppose I did this,
template<class T, tWord32 size>
class cBuffer { public: T * Address() { return &mBuff; };
private: T mBuff[size]; };
cBuffer<tWord32, 512> longBuff;
tWord32 * ptr = longBuff.Address();
Is the result of the inline method invocation expression "longBuff.Address()" a push statement that gets executed during global object initialization or is it treated as a field access expression and resolved at compile-time?
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |