mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
sprout/darkroom/* 追加
This commit is contained in:
parent
1c898f8b93
commit
212e9ea652
27 changed files with 1692 additions and 4 deletions
48
sprout/darkroom/access/access.hpp
Normal file
48
sprout/darkroom/access/access.hpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef SPROUT_DARKROOM_ACCESS_ACCESS_HPP
|
||||
#define SPROUT_DARKROOM_ACCESS_ACCESS_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/tuple/tuple.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace darkroom {
|
||||
namespace access {
|
||||
//
|
||||
// element
|
||||
//
|
||||
template<std::size_t I, typename T>
|
||||
struct element
|
||||
: public sprout::tuples::tuple_element<I, T>
|
||||
{};
|
||||
//
|
||||
// size
|
||||
//
|
||||
template<typename T>
|
||||
struct size
|
||||
: public sprout::tuples::tuple_size<T>
|
||||
{};
|
||||
//
|
||||
// unit
|
||||
//
|
||||
template<typename T>
|
||||
struct unit
|
||||
: public sprout::darkroom::access::element<0, T>
|
||||
{};
|
||||
//
|
||||
// get
|
||||
//
|
||||
template<std::size_t I, typename T>
|
||||
SPROUT_CONSTEXPR auto get(
|
||||
T&& t
|
||||
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<I>(sprout::forward<T>(t))))
|
||||
-> decltype(sprout::tuples::get<I>(sprout::forward<T>(t)))
|
||||
{
|
||||
return sprout::tuples::get<I>(sprout::forward<T>(t));
|
||||
}
|
||||
} // namespace access
|
||||
} // namespace darkroom
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_DARKROOM_ACCESS_ACCESS_HPP
|
Loading…
Add table
Add a link
Reference in a new issue