feat(list): add list templates

This commit is contained in:
fallenoak 2020-09-16 01:28:32 -05:00
parent 7713223e60
commit ced42bbfed
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
8 changed files with 434 additions and 0 deletions

View file

@ -0,0 +1,20 @@
#ifndef STORM_LIST_TS_GET_EXPLICIT_LINK_HPP
#define STORM_LIST_TS_GET_EXPLICIT_LINK_HPP
#include "list/TSLink.hpp"
#include <cstddef>
#include <cstdint>
template <class T>
class TSGetExplicitLink {
public:
// Static functions
static TSLink<T>* Link(const void* nodeptr, ptrdiff_t linkoffset);
};
template <class T>
TSLink<T>* TSGetExplicitLink<T>::Link(const void* nodeptr, ptrdiff_t linkoffset) {
return reinterpret_cast<TSLink<T>*>((reinterpret_cast<uintptr_t>(nodeptr) + linkoffset));
}
#endif