Example working demo fo paging using C++ and templates