Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
int n;
int **chess_desk = NULL;
struct dir_t {
int x;
int y;
} dirs[8] = {
#include <stdio.h>
#include <stdlib.h>
int n;
int *rows = NULL;
// Initialize global arrays
void init_glob (int n)
{
int i = 0;
#include <stdio.h>
#include <stdlib.h>
typedef long hash_t;
typedef long strlen_t;
char *string = NULL;
char *sample = NULL;
strlen_t n = 0;
#include <iostream>
#include <cstdlib>
#include <algorithm>
template <typename T>
class DD
{
private:
using T_ret_type = typename T::ret_type;
protected:
#include <iostream>
#include <cstdlib>
#include <algorithm>
// dd.hpp
template <typename Derived>
struct DD_traits;
template <typename T>
class DD
#include <thread>
#include <iostream>
#if 0
void thread_func()
{
std::cout << "Hello, parallel world!" << std::endl;
}
#else
class thread_hold
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef DEBUG
#define dbg printf ("R%d:I%d: ", rank, i);
#else
#define dbg if(0)
#endif /* DEBUG */
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef DEBUG
#define dbg printf ("R%d:I%d: ", rank, i);
#else
#define dbg if(0)
#endif /* DEBUG */
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef DEBUG
#define dbg
#else
#define dbg if(0)
#endif /* DEBUG */
main.cpp: In function 'int main()':
main.cpp:10:58: error: no matching function for call to 'for_each_n(std::vector<int>::iterator, int, main()::<lambda(auto:1&)>)'
10 | std::for_each_n(ns.begin(), 3, [](auto& n){ n *= 2; });
| ^
In file included from /usr/local/include/c++/9.2.0/algorithm:71,
from main.cpp:1:
/usr/local/include/c++/9.2.0/pstl/glue_algorithm_defs.h:46:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::for_each_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Function)'
46 | for_each_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, _Function __f);
| ^~~~~~~~~~
/usr/local/include/c++/9.2.0/pstl/glue_algorithm_defs.h:46:1: note: template argument deduction/substitution failed: