Misc: Swap make_array() for size deduction

This commit is contained in:
Stenzek
2023-10-02 13:33:33 +10:00
parent e33082778e
commit a96111eaeb
14 changed files with 197 additions and 173 deletions

View File

@ -29,7 +29,6 @@ add_library(common
layered_settings_interface.h
log.cpp
log.h
make_array.h
memmap.cpp
memmap.h
md5_digest.cpp

View File

@ -24,7 +24,6 @@
<ClInclude Include="layered_settings_interface.h" />
<ClInclude Include="log.h" />
<ClInclude Include="lru_cache.h" />
<ClInclude Include="make_array.h" />
<ClInclude Include="memmap.h" />
<ClInclude Include="memory_settings_interface.h" />
<ClInclude Include="md5_digest.h" />

View File

@ -21,7 +21,6 @@
<ClInclude Include="dimensional_array.h" />
<ClInclude Include="image.h" />
<ClInclude Include="minizip_helpers.h" />
<ClInclude Include="make_array.h" />
<ClInclude Include="thirdparty\StackWalker.h">
<Filter>thirdparty</Filter>
</ClInclude>

View File

@ -1,15 +0,0 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
#include <array>
#include <type_traits>
// Source: https://gist.github.com/klmr/2775736#file-make_array-hpp
template<typename... T>
constexpr auto make_array(T&&... values)
-> std::array<typename std::decay<typename std::common_type<T...>::type>::type, sizeof...(T)>
{
return {std::forward<T>(values)...};
}