mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
fix common_type: support C++14 version
This commit is contained in:
parent
bb0098ce09
commit
1bb9336d34
17 changed files with 191 additions and 10 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
#include <stdexcept>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/index_tuple/metafunction.hpp>
|
||||
|
@ -232,17 +233,17 @@ namespace sprout {
|
|||
|
||||
namespace detail {
|
||||
template<typename T, std::size_t N, sprout::index_t... Indexes>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, N>
|
||||
to_array_impl(T const (& arr)[N], sprout::index_tuple<Indexes...>) {
|
||||
return sprout::array<T, N>{{arr[Indexes]...}};
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename std::remove_cv<T>::type, N>
|
||||
to_array_impl(T (& arr)[N], sprout::index_tuple<Indexes...>) {
|
||||
return sprout::array<typename std::remove_cv<T>::type, N>{{arr[Indexes]...}};
|
||||
}
|
||||
} // namespace detail
|
||||
//
|
||||
// to_array
|
||||
//
|
||||
template<typename T, std::size_t N>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, N>
|
||||
to_array(T const (& arr)[N]) {
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename std::remove_cv<T>::type, N>
|
||||
to_array(T (& arr)[N]) {
|
||||
return sprout::detail::to_array_impl(arr, sprout::make_index_tuple<N>::make());
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue