@@ -320,8 +320,8 @@ template<class T, const size_t InitialPageCount>
320
320
__inline T &ContinuousPageStackOfFixedElements<T, InitialPageCount>::Iterator::operator *() const
321
321
{
322
322
Assert (*this );
323
- Assert (nextTop <= stack.nextTop );
324
- return *reinterpret_cast <T *>(&stack.Buffer ()[nextTop - sizeof (T)]);
323
+ Assert (this -> nextTop <= stack.nextTop );
324
+ return *reinterpret_cast <T *>(&stack.Buffer ()[this -> nextTop - sizeof (T)]);
325
325
}
326
326
327
327
template <class T , const size_t InitialPageCount>
@@ -334,7 +334,7 @@ template<class T, const size_t InitialPageCount>
334
334
__inline typename ContinuousPageStackOfFixedElements<T, InitialPageCount>::Iterator &ContinuousPageStackOfFixedElements<T, InitialPageCount>::Iterator::operator ++() // pre-increment
335
335
{
336
336
Assert (*this );
337
- nextTop -= sizeof (T);
337
+ this -> nextTop -= sizeof (T);
338
338
return *this ;
339
339
}
340
340
@@ -361,31 +361,31 @@ __inline ContinuousPageStackOfFixedElements<T, InitialPageCount>::ContinuousPage
361
361
template <class T , const size_t InitialPageCount>
362
362
__inline char * ContinuousPageStackOfFixedElements<T, InitialPageCount>::Push()
363
363
{
364
- return ContinuousPageStack::Push (sizeof (T));
364
+ return ContinuousPageStack<InitialPageCount> ::Push (sizeof (T));
365
365
}
366
366
367
367
template <class T , const size_t InitialPageCount>
368
368
__inline T* ContinuousPageStackOfFixedElements<T, InitialPageCount>::Top() const
369
369
{
370
- return reinterpret_cast <T*>(ContinuousPageStack::Top (sizeof (T)));
370
+ return reinterpret_cast <T*>(ContinuousPageStack<InitialPageCount> ::Top (sizeof (T)));
371
371
}
372
372
373
373
template <class T , const size_t InitialPageCount>
374
374
__inline T* ContinuousPageStackOfFixedElements<T, InitialPageCount>::Pop()
375
375
{
376
- return reinterpret_cast <T*>(ContinuousPageStack::Pop (sizeof (T)));
376
+ return reinterpret_cast <T*>(ContinuousPageStack<InitialPageCount> ::Pop (sizeof (T)));
377
377
}
378
378
379
379
template <class T , const size_t InitialPageCount>
380
380
__inline void ContinuousPageStackOfFixedElements<T, InitialPageCount>::UnPop()
381
381
{
382
- return ContinuousPageStack::UnPop (sizeof (T));
382
+ return ContinuousPageStack<InitialPageCount> ::UnPop (sizeof (T));
383
383
}
384
384
385
385
template <class T , const size_t InitialPageCount>
386
386
__inline void ContinuousPageStackOfFixedElements<T, InitialPageCount>::PopTo(const size_t position)
387
387
{
388
- ContinuousPageStack::PopTo (position);
388
+ ContinuousPageStack<InitialPageCount> ::PopTo (position);
389
389
}
390
390
391
391
// -----------------------------------------------------------------------------------------------------------------------------
@@ -407,8 +407,8 @@ template<class T, const size_t InitialPageCount>
407
407
__inline T &ContinuousPageStackOfVariableElements<T, InitialPageCount>::Iterator::operator *() const
408
408
{
409
409
Assert (*this );
410
- Assert (nextTop <= stack.nextTop );
411
- return *reinterpret_cast <T*>(reinterpret_cast <VariableElement *>(&stack.Buffer ()[nextTop - topElementSize])->Data ());
410
+ Assert (this -> nextTop <= stack.nextTop );
411
+ return *reinterpret_cast <T*>(reinterpret_cast <VariableElement *>(&stack.Buffer ()[this -> nextTop - this -> topElementSize ])->Data ());
412
412
}
413
413
414
414
template <class T , const size_t InitialPageCount>
@@ -421,8 +421,8 @@ template<class T, const size_t InitialPageCount>
421
421
__inline typename ContinuousPageStackOfVariableElements<T, InitialPageCount>::Iterator &ContinuousPageStackOfVariableElements<T, InitialPageCount>::Iterator::operator ++() // pre-increment
422
422
{
423
423
Assert (*this );
424
- Assert (nextTop <= stack.nextTop );
425
- topElementSize = reinterpret_cast <VariableElement *>(&stack.Buffer ()[nextTop -= topElementSize])->PreviousElementSize ();
424
+ Assert (this -> nextTop <= stack.nextTop );
425
+ topElementSize = reinterpret_cast <VariableElement *>(&stack.Buffer ()[this -> nextTop -= this -> topElementSize ])->PreviousElementSize ();
426
426
return *this ;
427
427
}
428
428
@@ -482,22 +482,23 @@ __inline char* ContinuousPageStackOfVariableElements<T, InitialPageCount>::Push(
482
482
{
483
483
TemplateParameter::SameOrDerivedFrom<ActualT, T>(); // ActualT must be the same type as, or a type derived from, T
484
484
VariableElement *const element =
485
- new (ContinuousPageStack::Push (VariableElement::Size<ActualT>())) VariableElement (topElementSize);
486
- topElementSize = VariableElement::Size<ActualT>();
485
+ new (ContinuousPageStack<InitialPageCount>::Push (VariableElement::template
486
+ Size<ActualT>())) VariableElement (topElementSize);
487
+ topElementSize = VariableElement::template Size<ActualT>();
487
488
return element->Data ();
488
489
}
489
490
490
491
template <class T , const size_t InitialPageCount>
491
492
__inline T* ContinuousPageStackOfVariableElements<T, InitialPageCount>::Top() const
492
493
{
493
- VariableElement* const element = reinterpret_cast <VariableElement*>(ContinuousPageStack::Top (topElementSize));
494
+ VariableElement* const element = reinterpret_cast <VariableElement*>(ContinuousPageStack<InitialPageCount> ::Top (topElementSize));
494
495
return element == 0 ? 0 : reinterpret_cast <T*>(element->Data ());
495
496
}
496
497
497
498
template <class T , const size_t InitialPageCount>
498
499
__inline T* ContinuousPageStackOfVariableElements<T, InitialPageCount>::Pop()
499
500
{
500
- VariableElement *const element = reinterpret_cast <VariableElement*>(ContinuousPageStack::Pop (topElementSize));
501
+ VariableElement *const element = reinterpret_cast <VariableElement*>(ContinuousPageStack<InitialPageCount> ::Pop (topElementSize));
501
502
if (element == 0 )
502
503
return 0 ;
503
504
else
@@ -512,19 +513,21 @@ template<class ActualT>
512
513
__inline void ContinuousPageStackOfVariableElements<T, InitialPageCount>::UnPop()
513
514
{
514
515
TemplateParameter::SameOrDerivedFrom<ActualT, T>(); // ActualT must be the same type as, or a type derived from, T
515
- ContinuousPageStack::UnPop (VariableElement::Size<ActualT>());
516
- Assert (reinterpret_cast <VariableElement*>(ContinuousPageStack::Top (VariableElement::Size<ActualT>()))->PreviousElementSize () == topElementSize);
517
- topElementSize = VariableElement::Size<ActualT>();
516
+ ContinuousPageStack<InitialPageCount>::UnPop (VariableElement::template
517
+ Size<ActualT>());
518
+ Assert (reinterpret_cast <VariableElement*>(ContinuousPageStack<InitialPageCount>::Top (VariableElement::template
519
+ Size<ActualT>()))->PreviousElementSize () == topElementSize);
520
+ topElementSize = VariableElement::template Size<ActualT>();
518
521
}
519
522
520
523
template <class T , const size_t InitialPageCount>
521
524
__inline void ContinuousPageStackOfVariableElements<T, InitialPageCount>::PopTo(const size_t position)
522
525
{
523
- Assert (position <= nextTop);
524
- if (position != nextTop)
526
+ Assert (position <= this -> nextTop );
527
+ if (position != this -> nextTop )
525
528
{
526
- Assert (position + sizeof (VariableElement) <= nextTop);
527
- topElementSize = reinterpret_cast <VariableElement *>(&Buffer ()[position])->PreviousElementSize ();
529
+ Assert (position + sizeof (VariableElement) <= this -> nextTop );
530
+ topElementSize = reinterpret_cast <VariableElement *>(&this -> Buffer ()[position])->PreviousElementSize ();
528
531
}
529
- ContinuousPageStack::PopTo (position);
532
+ ContinuousPageStack<InitialPageCount> ::PopTo (position);
530
533
}
0 commit comments