source: src/examples/gc_no_raii/src/vector.h @ c44e622

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since c44e622 was c44e622, checked in by Thierry Delisle <tdelisle@…>, 9 years ago

intermediate implementation of vector

  • Property mode set to 100644
File size: 265 bytes
Line 
1
2
3context allocator(type T, type all) {
4        T realloc(all*, size_t);
5};
6
7forall(type T, type all | allocator(T, all))
8struct vector
9{
10        T *m_data;
11};
12
13// forall(type T, type all)
14// void push_back(vector(T, all)* this, T value)
15// {
16//      (*(this->m_data)) = value;
17// }
Note: See TracBrowser for help on using the repository browser.