6 #include <l4/cxx/type_traits>
10 template< typename T >
11 class Static_container
14 void operator = (Static_container const &) = delete;
15 Static_container(Static_container const &) = delete;
16 Static_container() = default;
18 T *get() { return reinterpret_cast<T*>(_s); }
19 T *operator -> () { return get(); }
20 T &operator * () { return *get(); }
21 operator T* () { return get(); }
24 { new (reinterpret_cast<void*>(_s)) T; }
26 template< typename ...Args >
27 void construct(Args... args)
28 { new (reinterpret_cast<void*>(_s)) T(cxx::forward<Args>(args)...); }
31 char _s[sizeof(T)] __attribute__((aligned(__alignof(T))));