Empirical
Classes | Namespaces | Functions
vector.h File Reference

A drop-in wrapper for std::vector; adds on bounds checking in debug mode. More...

#include <initializer_list>
#include <iterator>
#include <utility>
#include <vector>
#include "assert.h"

Go to the source code of this file.

Classes

class  emp::vector< T, Ts >
 Build a debug wrapper emp::vector around std::vector. More...
 
struct  emp::vector< T, Ts >::iterator_wrapper< ITERATOR_T >
 Setup an iterator wrapper to make sure that they're not used again after a vector changes. More...
 
class  emp::vector< bool, Ts... >
 Build a specialized debug wrapper for emp::vector<bool> More...
 

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Functions

template<typename T , typename... Ts>
std::ostream & operator<< (std::ostream &out, const emp::vector< T, Ts... > &v)
 
template<typename T , typename... Ts>
std::istream & operator>> (std::istream &is, emp::vector< T, Ts... > &v)
 

Detailed Description

A drop-in wrapper for std::vector; adds on bounds checking in debug mode.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2016-2018
Note
Status: BETA

This class is a drop-in wrapper for std::vector, adding on bounds checking. If EMP_NDEBUG is set then it reverts back to std::vector.

Todo:
Debug code: member functions that take iterators should also take emp iterators that verify whether those iterators are valid.

Function Documentation

template<typename T , typename... Ts>
std::ostream& operator<< ( std::ostream &  out,
const emp::vector< T, Ts... > &  v 
)
template<typename T , typename... Ts>
std::istream& operator>> ( std::istream &  is,
emp::vector< T, Ts... > &  v 
)