mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-05-10 09:23:30 +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>
|
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)>
|
inline SPROUT_CONSTEXPR sprout::array<typename sprout::common_decay<Types...>::type, sizeof...(Types)>
|
||||||
make_array(Types&&... args) {
|
make_array(Types&&... args) {
|
||||||
typedef sprout::array<
|
typedef typename sprout::common_decay<Types...>::type value_type;
|
||||||
typename sprout::common_decay<Types...>::type,
|
typedef sprout::array<value_type, sizeof...(Types)> type;
|
||||||
sizeof...(Types)
|
return type{{value_type(SPROUT_FORWARD(Types, args))...}};
|
||||||
> type;
|
}
|
||||||
return type{{typename sprout::common_decay<Types...>::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…
Add table
Reference in a new issue