mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(list): add list templates
This commit is contained in:
parent
7713223e60
commit
ced42bbfed
8 changed files with 434 additions and 0 deletions
21
storm/list/TSGetLink.hpp
Normal file
21
storm/list/TSGetLink.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef STORM_LIST_TS_GET_LINK_HPP
|
||||
#define STORM_LIST_TS_GET_LINK_HPP
|
||||
|
||||
#include "list/TSLink.hpp"
|
||||
#include "list/TSLinkedNode.hpp"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
template <class T>
|
||||
class TSGetLink {
|
||||
public:
|
||||
// Static functions
|
||||
static TSLink<T>* Link(const TSLinkedNode<T>* nodeptr, ptrdiff_t linkoffset);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
TSLink<T>* TSGetLink<T>::Link(const TSLinkedNode<T>* nodeptr, ptrdiff_t linkoffset) {
|
||||
return reinterpret_cast<TSLink<T>*>(reinterpret_cast<uintptr_t>(nodeptr));
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue