40#if __cplusplus < 201103L
46 template<
typename InputIterator,
47 typename OutputIterator,
49 OutputIterator
copy_if(InputIterator begin, InputIterator end, OutputIterator destBegin, Predicate p) {
50 while (begin != end) {
52 *destBegin++ = *begin;
61#ifdef PERMLIB_DOMAIN_INT
62 typedef unsigned int dom_int;
64 typedef unsigned short int dom_int;
68 inline unsigned int randomInt(
unsigned int upperBound) {
69 return std::rand() % upperBound;
72 template<
class Iterator>
73 inline void print_iterable(Iterator begin, Iterator end,
int offset,
const char* name) {
74 std::cout << name <<
" : ";
75 while (begin != end) {
76 std::cout << (*begin++) + offset <<
",";
78 std::cout << std::endl;
84 void operator()(T *ptr){
delete ptr; }
87#ifdef PERMLIB_DEBUG_OUTPUT
88#define PERMLIB_DEBUG(X) X
90#define PERMLIB_DEBUG(X)
OutputIterator copy_if(InputIterator begin, InputIterator end, OutputIterator destBegin, Predicate p)
copies elements of (begin to end) to destBegin if they match the given predicate
Definition: common.h:49
callable object to delete a pointer
Definition: common.h:82