Constructors -- default, normal (when you specify size), and copy
| 1981 | public: |
| 1982 | // Constructors -- default, normal (when you specify size), and copy |
| 1983 | explicit sparsetable(size_type sz = 0, const allocator_type &alloc = allocator_type()) : |
| 1984 | _first_group(0), |
| 1985 | _last_group(0), |
| 1986 | _table_size(sz), |
| 1987 | _num_buckets(0), |
| 1988 | _group_alloc(alloc), |
| 1989 | _alloc(alloc) |
| 1990 | // todo - copy or move allocator according to |
| 1991 | // http://en.cppreference.com/w/cpp/container/unordered_map/unordered_map |
| 1992 | { |
| 1993 | _allocate_groups(num_groups(sz)); |
| 1994 | } |
| 1995 | |
| 1996 | ~sparsetable() |
| 1997 | { |