title: LRU implementation in production code
body: <p>I have some C++ code where I need to implement cache replacement using LRU technique.<br>
  So far I know two methods to implement LRU cache replacement:  </p>
  
  <ol>
  <li>Using timeStamp for each time the cached data is accessed and finally comparing the timeStamps at time of replacement.</li>
  <li>Using a stack of cached items and moving them to the top if they are accessed recently, so finally the bottom will contain the LRU Candidate.</li>
  </ol>
  
  <p>So, which of these is better to be used in production code?<br>
  Are their any other better methods?</p>