mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
add make_array_without_narrowing
This commit is contained in:
parent
36fe036f38
commit
6a6fdd41ec
1 changed files with 19 additions and 5 deletions
|
@ -33,11 +33,25 @@ namespace sprout {
|
|||
template<sprout::detail::make_array_t = sprout::detail::make_array_in_common_elements, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename sprout::common_decay<Types...>::type, sizeof...(Types)>
|
||||
make_array(Types&&... args) {
|
||||
typedef sprout::array<
|
||||
typename sprout::common_decay<Types...>::type,
|
||||
sizeof...(Types)
|
||||
> type;
|
||||
return type{{typename sprout::common_decay<Types...>::type(SPROUT_FORWARD(Types, args))...}};
|
||||
typedef typename sprout::common_decay<Types...>::type value_type;
|
||||
typedef sprout::array<value_type, sizeof...(Types)> type;
|
||||
return type{{value_type(SPROUT_FORWARD(Types, args))...}};
|
||||
}
|
||||
|
||||
//
|
||||
// make_array_without_narrowing
|
||||
//
|
||||
template<typename T, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename std::remove_cv<T>::type, sizeof...(Types)>
|
||||
make_array_without_narrowing(Types&&... args) {
|
||||
return sprout::array<typename std::remove_cv<T>::type, sizeof...(Types)>{{SPROUT_FORWARD(Types, args)...}};
|
||||
}
|
||||
template<sprout::detail::make_array_t = sprout::detail::make_array_in_common_elements, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename sprout::common_decay<Types...>::type, sizeof...(Types)>
|
||||
make_array_without_narrowing(Types&&... args) {
|
||||
typedef typename sprout::common_decay<Types...>::type value_type;
|
||||
typedef sprout::array<value_type, sizeof...(Types)> type;
|
||||
return type{{SPROUT_FORWARD(Types, args)...}};
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue