This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <thread> | |
void do_parallel (size_t n) | |
{ | |
std::vector<int> a (n), b (n); | |
double c = clock (); | |
std::vector<std::thread> threads; | |
int total_threads = std::thread::hardware_concurrency (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <int x> struct C {}; | |
template<> | |
struct C<0> { using type = void; }; | |
struct D : C<1>, C<0> {}; | |
template <typename A = C<0>, typename = typename A::type> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <int x> struct C {}; | |
template<> | |
struct C<0> { using type = void; }; | |
struct D : C<1>, C<0> {}; | |
template <typename A = C<0>, typename = typename A::type> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <functional> | |
#include <typeinfo> | |
struct C { std::function<void ()> func = [] {}; C () { } }; | |
const type_info &g (); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <utility> | |
#include <initializer_list> | |
#include <stddef.h> | |
using namespace std; | |
#define USE_RECURSION 0 | |
#if USE_RECURSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tuple> | |
#include <initializer_list> | |
#include <math.h> | |
#include <utility> | |
using namespace std; | |
#define USE_RECURSION 1 | |
#if USE_RECURSION | |
template <int I> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tuple> | |
#include <initializer_list> | |
#include <math.h> | |
#include <utility> | |
using namespace std; | |
template <typename Tup1, typename Tup2, size_t...s> | |
double euclidean_distance_impl (Tup1 const &tup1, Tup2 const &tup2, index_sequence<s...>) |