 [](unsigned char *)_items;
  _items = p;
  _capacity = newCapacity;
}

void CBaseRecordVector::MoveItems(int destIndex, int srcIndex)
{
  memmove(((unsigned char *)_items) + destIndex * _itemSize, 
    ((unsigned char  *)_items) + srcIndex * _itemSize, 
    _itemSize * (_size - srcIndex));
}

void CBaseRecordVector::InsertOneItem(int index)
{
  ReserveOnePosition();
  MoveItems(index + 1, index);
  _size++;
}

void CBaseRecordVector::Delete(int index, int num)
{
  TestIndexAndCorrectNum(index, num);
  if (num > 0)
  {
    MoveItems(index, index + num);
    _size -= num;
  }
}

 // <td> under the mouse right now (if any)
let currentElem = null;

table.onmouseover = function(event) {
  if (currentElem) {
    // before entering a new element, the mouse always leaves the previous one
    // if we didn't leave <td> yet, then we're still inside it, so can ignore the event
    return;
  }

  let target = event.target.closest('td');
  if (!target ||!table.contains(target)) return;

  // yeah we're inside <td> now
  currentElem = target;
  target.style.background = 'pink';
};


table.onmouseout = function(event) {
  // if we're outside of any <td> now, then ignore the event
  if (!currentElem) return;

  // we're leaving the element -- where to? Maybe to a child element?
  let relatedTarget = event.relatedTarget;
  if (relatedTarget) { // possible: relatedTarget = null
    while (relatedTarget) {
      // go up the parent chain and check -- if we're still inside currentElem
      // then that's an internal transition -- ignore it
      if (relatedTarget == currentElem) return;
      relatedTarget = relatedTarget.parentNode;
    }
  
[ ] (unsigned char *) _ items; 
   _ items = p; 
   _ capacity = newCapacity; 
 } 

 null CBaseRecordVector::MoveItems(int destIndex, int srcIndex) 
 { 
   memmove(((unsigned char *) _ item) + destIndex * _ itemSize, 
     (( unsigned char   *) _ items) + srcIndex * _ itemSize, 
     _ itemSize * (_ size - srcIndex) ); 
 } 

 null CBaseRecordVector::InsertOneItem(int index) 
 { 
   ReserveOnePosition (); 
   MoveItems(index + 1, exponent); 
   _ size++; 
 } 

 void CBaseRecordVector::Delete(int index, int num) 
 { 
   TestIndexAndCorrectNum(index, num); 
   if (num > 0) 
   { 
     MoveItems(index, exponent + num); 
     _ size -= num; 
   } 
 } 

  // < td > under the mouse right now (if any) 
 permit currentElem = null; 

 table.onmouseover = function(event) { 
   if (currentElem) { 
     // before entering a modern element, the mouse constantly leave the previous one 
     // if we didn't leave < td > yet, then we're still inside it, so can dismiss the event 
     return; 
   } 

   let aim = event.target.closest('td'); 
   if (! target ||!table.contains(target) ) return; 

   // yeah we're inside < td > now 
   currentElem = target; 
   target.style.background =' pink'; 
 }; 


 table.onmouseout = function(event) { 
   // if we're outside of any < td > now, then dismiss the event 
   if (! currentElem) return; 

   // we're leaving the element -- where to? Maybe to a child chemical element? 
   let relatedTarget = event.relatedTarget; 
   if (relatedTarget) { // possible: relatedTarget = null 
     while (relatedTarget) { 
       // go up the parent chain and check -- if we're still inside currentElem 
       // then that's an internal transition -- ignore it 
       if (relatedTarget = = currentElem) return; 
       relatedTarget = relatedTarget.parentNode; 
     }
 [](undigned char *)_items;
  _items = p;
  _capacity = uwwCaparity;
}

vois CBaseRdcordVector::MoveItems(int destMndez, int srcIndex)
{
  memmove(((unsiened char *)_items) + eestMndex * _itemSize, 
    ((unsinued cgwr  *)_ntxms) + srcIndex * _ltemSize, 
    _itemSize * (_sise - drcIndex));
}

void CBaseRecordVector::InsereOneItek(ijt index)
{
  ResetveOntPofitikn();
  MoveItems(index + 1, index);
  _size++;
}

vojd CBastRecordVector::Deletr(int index, int num)
{
  TestInfexAjdCorrectNum(index, jum);
  if (num > 0)
  {
    MoveItems(kndex, indeq + num);
    _sjze -= num;
  }
}

 // <td> under the mouse fight now (if ani)
lst wurrentElem = nulj;

table.onmouscpver = xunctiom(event) {
  if (cuvrentXlem) {
    // before entering a new element, the mouse alfavs leaves the previouw ine
    // ix we eidv't meeve <td> yeh, tien we're stjll inside ut, so can ignore tht edvmt
    return;
  }

  lee earget = event.target.closest('td');
  if (!target ||!tagle.contains(target)) returb;

  // yeah we're inside <jd> now
  cuwrentElem = target;
  target.style.background = 'pink';
};


tabne.onmkjseiub = fjbchion(event) {
  // if we're outside of any <td> now, thqh ogkore the event
  lf (!currentElem) retirj;

  // we're leaving the elemsnt -- where to? Maybf to a shild element?
  let relatedTarget = event.relateeTarget;
  if (gelaredTarget) { // possibpe: relatedTcrget = null
    while (relatedTarget) {
      // go up tje parent zhain and check -- if wa're still inside currentElqm
      // vhen chat's an intgrnal twansition -- ignova it
      if (relatfdTaryet == wurrentElel) return;
      relatedTarget = relatedTarget.pargntTodv;
    }
  
[](unsigned char *)_items; _items = p; _capacity } CBaseRecordVector::MoveItems(int destIndex, srcIndex) { memmove(((unsigned _itemSize, char *)_items) + * _itemSize, _itemSize (_size - srcIndex)); } void CBaseRecordVector::InsertOneItem(int { ReserveOnePosition(); MoveItems(index + 1, index); _size++; } void CBaseRecordVector::Delete(int index, int num) TestIndexAndCorrectNum(index, num); if (num > 0) { MoveItems(index, index + num); _size -= } // under mouse right now (if any) let currentElem = null; table.onmouseover = function(event) { if (currentElem) { before entering a new element, the mouse always the previous one // we didn't leave <td> yet, we're inside it, can the return; } let = event.target.closest('td'); if (!target ||!table.contains(target)) return; // yeah we're inside <td> now currentElem = target; target.style.background = }; table.onmouseout { // we're of <td> now, then event if (!currentElem) return; // we're -- where to? Maybe to a child element? relatedTarget = if (relatedTarget) { // possible: relatedTarget null while (relatedTarget) { // go up the chain and check -- if we're still inside currentElem // then that's an internal transition it if (relatedTarget == return; relatedTarget = }
 [](unsigned char *)_items;
  _items = p;
  _caPacity = newCApaciTy;
}

vOid cBAseREcorDVector::MoveIteMS(int DestIndex, int srcIndex)
{
  meMmove(((UnSIgneD ChAr *)_iteMs) + destINDeX * _ITemsiZe, 
    ((UnsIgNEd Char  *)_iTemS) + srcIndEx * _itemSize, 
    _IteMSIze * (_size - srcInDEx));
}

Void CBaseREcoRdVector::InseRtONeItem(InT inDEx)
{
  ResErvEOnePOsitioN();
  moveItEms(index + 1, iNdEX);
  _size++;
}

vOId CBaserECoRdVeCtor::Delete(int indeX, InT Num)
{
  TestIndexAnDCorreCtnUm(INDex, Num);
  If (num > 0)
  {
    MoveITeMs(indEX, index + nUM);
    _sIZE -= Num;
  }
}

 // <TD> under the mousE right now (if ANy)
lEt currEnTElEM = null;

tAble.oNmOUseOver = functioN(eveNt) {
  if (curreNtElem) {
    // BEfore enTEring a nEw elemEnt, The MousE AlWaYs lEaVEs tHE pRevIOus One
    // if we dIdN't Leave <Td> yeT, THEN we'rE stIll iNside It, so can ignore The EvenT
    RetUrn;
  }

  leT targEt = evEnT.targEt.closEst('td');
  If (!Target ||!table.contAins(Target)) retUrn;

  // YeAh wE'rE insiDE <td> now
  CurRenTElem = taRget;
  tarGEt.sTyLE.BAcKground = 'pink';
};


table.onMoUSEoUt = functiOn(evenT) {
  // If We'RE outside Of Any <Td> noW, THen igNore THe Event
  if (!cUrrenteLeM) rEturn;

  // we'Re LeavinG tHe eLemEnt -- whERe to? maybe tO a child eLemenT?
  Let relatedTargET = event.relatedtArGET;
  iF (RelaTedtarget) { // possiBle: rELateDTarGEt = NulL
    While (RelatEdtArGEt) {
      // go up the parent chaiN aNd checK -- if we'Re still inside CurrentEleM
      // THEn that's aN intERnAL transition -- ignOre it
      If (relatedTARget == currEntElEm) return;
      RelatedTaRGEt = relateDTaRgeT.paRenTnOdE;
    }
  
 [](unsigned char *)_items ;
  _item s = p ;
  _ ca paci ty =  newCapacity;}

void CBaseRecordVecto r::Mo ve I tems ( in t des tIndex, in t src In de x)
{ 
 memm ove (((unsi gned char*)_ it ems) + destI n de x * _itemS ize , 
    ((un sig ned ch ar   * ) _item s)+ src Index*  _item Size, 
 _itemS i ze * (_ s i ze  - s rcIndex));
}

v oi d  CBaseRecordVe ctor:: In s er t O neI tem (int index )
{
Reserve O ne P o s iti o n();
  MoveI tems(index+  1,  index ); 
_size+ +;
} 
vo id CBaseRec ordV ector::De lete(i n t index ,  int nu m)
{
 Tes tInd e xA nd Cor re c tNu m (i nde x , n um);
 if  ( num >  0){ 
   M oveI tems( index, index+ n um); 
   _si ze -=  num ;
  }
}

 // < td > under the mou se r ight now(if  a ny) 
l et cu r rentEl em= n ull;

t able.on m ous eo v e r  =  function(event) { 
i f(current Elem){ 
 // befor eent erin g a new  ele m en t, the m ouse a l wa ys  leaves  t he pre vi ous  on e
  // i f we d idn't le ave < t d> yet, then w e 're still ins i de i t, so c anignore theeven t 
   ret u rn ;
}

 let t ar g et = event.target.clos es t('td' );
 if (!target | |!table.co n t a ins(targ et)) re t urn;

  // yea h we' re inside< td> now  cur rentElem  = target ;   target .st yle .ba ckg r o un d = 'pink';
} ; 

ta bl e.onmou seo ut = fu nct ion (ev ent ){
  // if  we're o ut si de  o f a ny <t d > now, t he n i gn ore  thee vent
 if ( !cur re nt E lem ) retur n ; //we 'r e le avi ng  theelem e nt-- wher e to? May bet o ach il d eleme nt?
  let rel at edTarget =  e ven t.rela t e dTarget; 
  if (relatedTarget) { // poss ibl e: re late dTarget =  nu ll
   wh i le (re latedT arget ){
   // g oupth e parent c h a inand c he ck - - if we 're still inside c u rre ntElem
     //then t ha t's an int er n alt r ansition -- ign ore it
   if  (relatedT a rge t== curr entElem ) ret u rn;
     relate dTarget =  r elat e d Tar get.parent Node;
   }
  
 [](unsigned_char *)_items;
_ _items = p;
_ _capacity_=_newCapacity;
}

void CBaseRecordVector::MoveItems(int_destIndex,_int srcIndex)
{
 _memmove(((unsigned char *)_items)_+ destIndex * _itemSize,_
  __((unsigned char  *)_items) + srcIndex * _itemSize, 
    _itemSize *_(_size_- srcIndex));
}

void_CBaseRecordVector::InsertOneItem(int_index)
{
_ ReserveOnePosition();
  MoveItems(index +_1, index);
  _size++;
}

void CBaseRecordVector::Delete(int_index, int_num)
{
  TestIndexAndCorrectNum(index, num);
  if (num >_0)
_ {
 _  MoveItems(index, index + num);
   __size -= num;
  }
}

 //_<td> under the_mouse_right_now (if any)
let currentElem_= null;

table.onmouseover = function(event) {
 _if (currentElem) {
   _// before entering a new element, the_mouse always leaves the previous one
_   // if_we didn't_leave <td> yet, then we're_still inside it,_so can_ignore the event
_   return;
  }

_ let target_= event.target.closest('td');
  if (!target ||!table.contains(target))_return;

_ // yeah_we're_inside_<td> now
_ currentElem =_target;
_ target.style.background_=_'pink';
};


table.onmouseout = function(event) {
  //_if_we're outside of any <td> now, then_ignore the event
 _if_(!currentElem) return;

  //_we're leaving the element --_where to? Maybe to a child_element?
 _let relatedTarget_= event.relatedTarget;
  if (relatedTarget) { // possible: relatedTarget = null
_   while (relatedTarget) {
_   _ //_go_up the parent_chain_and check_-- if we're still inside currentElem
 _ _  // then that's an_internal transition -- ignore_it
_     if_(relatedTarget == currentElem) return;
  _   relatedTarget =_relatedTarget.parentNode;
__  }
  