File: test_stack_alloc.cc

package info (click to toggle)
cpp-jwt 1.5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 508 kB
  • sloc: cpp: 3,374; ansic: 33; sh: 31; makefile: 12
file content (22 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <vector>
#include "jwt/stack_alloc.hpp"

template <typename T, size_t SZ = 2>
using SmallVector = std::vector<T, jwt::stack_alloc<T, SZ, alignof(T)>>;


int main()
{
  SmallVector<int>::allocator_type::arena_type a;
  SmallVector<int> v{a};

  v.push_back(1);
  v.push_back(1);
  v.push_back(1);
  v.push_back(1);
  v.push_back(1);
  v.push_back(1);

  return 0;
}