mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
modify: tuple and hash support(class adapt) implemented in each class headers.
This commit is contained in:
parent
3a2610cb5c
commit
ee8c952d05
35 changed files with 1720 additions and 1557 deletions
35
sprout/array/make_array.hpp
Normal file
35
sprout/array/make_array.hpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#ifndef SPROUT_ARRAY_MAKE_ARRAY_HPP
|
||||
#define SPROUT_ARRAY_MAKE_ARRAY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/index_tuple.hpp>
|
||||
#include <sprout/array/array.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// make_array
|
||||
//
|
||||
template<typename T, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, sizeof...(Types)> make_array(Types&&... args) {
|
||||
return sprout::array<T, sizeof...(Types)>{{sprout::forward<Types>(args)...}};
|
||||
}
|
||||
|
||||
//
|
||||
// make_common_array
|
||||
//
|
||||
template<typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<
|
||||
typename std::decay<typename std::common_type<typename std::decay<Types>::type...>::type>::type,
|
||||
sizeof...(Types)
|
||||
> make_common_array(Types&&... args) {
|
||||
return sprout::array<
|
||||
typename std::decay<typename std::common_type<typename std::decay<Types>::type...>::type>::type,
|
||||
sizeof...(Types)
|
||||
>{{sprout::forward<Types>(args)...}};
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_ARRAY_MAKE_ARRAY_HPP
|
Loading…
Add table
Add a link
Reference in a new issue