|
[Sponsors] |
November 7, 2005, 01:18 |
Class UList Declaration:
te
|
#1 |
Member
Leosding
Join Date: Mar 2009
Posts: 51
Rep Power: 17 |
Class UList Declaration:
template<class> class UList { // Private data //- Number of elements in UList. label size_; //- Vector of values of type T. T* restrict v_; ... ; and the Clss List is derived from class UList,like this: template<class> class List : public UList<t> its constructor: // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // Construct with length specified template<class> List<t>::List(const label s) : UList<t>(NULL, s) { if (this->size_ < 0) { FatalErrorIn("List<t>::List(const label size)") <<>size_ << abort(FatalError); if (this->size_) { this->v_ = new T[this->size_]; else { this->v_ = 0; } } } size_ and v_ is from class UList as private data, why can they be used in derived class UList? would somebody give me some help! |
|
December 2, 2005, 00:52 |
The class List is the friend c
|
#2 |
Member
Leosding
Join Date: Mar 2009
Posts: 51
Rep Power: 17 |
The class List is the friend class of UList.
I just find the statement in code. sigh. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tmp class | maka | OpenFOAM Bugs | 2 | August 20, 2008 15:53 |
How to add a new class locally | ville | OpenFOAM | 4 | December 11, 2006 14:20 |
Class Project | Tiger | Main CFD Forum | 5 | March 13, 2006 16:58 |
CFD class notes | Lee | Main CFD Forum | 0 | January 30, 2004 13:39 |