libvata2  [unstable] git snapshot
Classes | Namespaces | Macros | Functions
util.hh File Reference
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

struct  TuplePrinter< Tuple, N >
 
struct  hash< std::pair< A, B > >
 A hasher for pairs. More...
 
struct  hash< std::set< A > >
 A hasher for sets. More...
 
struct  hash< std::vector< A > >
 A hasher for vectors. More...
 
struct  TuplePrinter< Tuple, N >
 
struct  TuplePrinter< Tuple, 1 >
 

Namespaces

 Vata2
 
 Vata2::util
 

Macros

#define DEBUG_PRINT(x)   { std::cerr << "debug: " << x << "\n"; }
 
#define DEBUG_PRINT_LN(x)   { DEBUG_PRINT(__func__ << ":" << __LINE__ << ": " << x) }
 
#define WARN_PRINT(x)   { std::cerr << "warning: " << x << "\n"; }
 

Functions

template<class T >
bool are_disjoint (const std::set< T > &lhs, const std::set< T > &rhs)
 Are two sets disjoint? More...
 
template<class T >
size_t hash_combine (size_t lhs, const T &rhs)
 Combine two hash values. More...
 
template<typename It >
size_t hash_range (It first, It last)
 Hashes a range. More...
 
template<class T , class K >
bool haskey (const T &cont, const K &key)
 checks whether a container with find contains a key More...
 
template<template< class, class, class...> class Map, class T1 , class T2 , class... Args>
Map< T2, T1 > invert_map (const Map< T1, T2 > &mp)
 inverts a map (should work for std::map and std::unordered_map) More...
 
template<class A >
std::string to_string (const A &value)
 arbitrary type with the << operator More...
 
template<class A >
std::string to_string (const std::set< A > &st)
 set to string More...
 
template<class A >
std::string to_string (const std::vector< A > &vec)
 Vector to string. More...
 
template<class A >
std::string to_string (const std::list< A > &vec)
 List to string. More...
 
template<class A >
std::string to_string (const std::stack< A > &stck)
 stack to string More...
 
template<class A >
std::string to_string (const std::function< A > &fun)
 function to string More...
 
template<class A , class B >
std::string to_string (const std::pair< A, B > &p)
 
template<class A , class B >
std::string to_string (const std::unordered_map< A, B > &unmap)
 unordered_map to string More...
 
template<class A , class B >
std::string to_string (const std::map< A, B > &mp)
 map to string More...
 
std::string to_string (char ch)
 Character to string. More...
 
std::string to_string (const std::string &str)
 String to string. More...
 
template<class... Ts>
std::string to_string (const std::tuple< Ts...> &tup)
 tuple to string More...
 

Macro Definition Documentation

#define DEBUG_PRINT (   x)    { std::cerr << "debug: " << x << "\n"; }

Definition at line 33 of file util.hh.

#define DEBUG_PRINT_LN (   x)    { DEBUG_PRINT(__func__ << ":" << __LINE__ << ": " << x) }

Definition at line 34 of file util.hh.

#define WARN_PRINT (   x)    { std::cerr << "warning: " << x << "\n"; }

Definition at line 35 of file util.hh.