run vector
This commit is contained in:
14
src/utils/meson.build
Normal file
14
src/utils/meson.build
Normal file
@@ -0,0 +1,14 @@
|
||||
headers = ['utils.hpp']
|
||||
sources = []
|
||||
|
||||
lib = library(
|
||||
'utils',
|
||||
include_directories : inc,
|
||||
install : true,
|
||||
sources: [headers, sources]
|
||||
)
|
||||
|
||||
utils_dep = declare_dependency(
|
||||
include_directories: inc,
|
||||
link_with: lib
|
||||
)
|
||||
19
src/utils/utils.hpp
Normal file
19
src/utils/utils.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace hack::utils
|
||||
{
|
||||
template<typename T, size_t N>
|
||||
struct generate_tuple
|
||||
{
|
||||
using type = decltype(std::tuple_cat(typename generate_tuple<T, N - 1>::type{}, std::make_tuple(T{})));
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct generate_tuple<T, 1>
|
||||
{
|
||||
using type = std::tuple<T>;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user