/** \file helpers.hpp * * Declaration of some auxiliary functions for memory dis-/allocation and so on */ #ifndef HELPERS_HELPERS_HPP_ #define HELPERS_HELPERS_HPP_ using namespace std; /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include /********************************************** helpful template functions *********************************/ inline void performCriticalExit() { exit(255); } // this is to allow different modes of access for // maps and sets template struct _take{ Res get(T value) const; T getKey(T value) const; }; // if we have a set,vector etc we can directly access the result template struct _take{ static inline Res get(Res value){ return value; } static inline Res getKey(Res value){ return value; } }; // if we have a map we have to access the second part of // the pair and offer getKey for access to first template struct _take >{ static inline Res get(std::pair value){ return value.second; } static inline T1 getKey(std::pair value){ return value.first; } }; #endif /* HELPERS_HELPERS_HPP_*/