libostd/ostd/internal/tuple.hh

36 lines
814 B
C++
Raw Normal View History

2015-07-11 01:38:11 +00:00
/* Some tuple internals for inclusion from various headers. Partially
* taken from the libc++ project.
*
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
2015-07-13 19:08:55 +00:00
#ifndef OSTD_INTERNAL_TUPLE_HH
#define OSTD_INTERNAL_TUPLE_HH
2015-07-11 01:38:11 +00:00
2017-01-28 17:30:31 +00:00
#include <tuple>
#include <utility>
2017-01-28 17:30:31 +00:00
2015-07-13 19:07:14 +00:00
namespace ostd {
2015-07-11 01:38:11 +00:00
/* is tuple-like */
template<typename T>
constexpr bool IsTupleLike = false;
2016-01-20 18:09:44 +00:00
template<typename T>
constexpr bool IsTupleLike<const T> = IsTupleLike<T>;
template<typename T>
constexpr bool IsTupleLike<volatile T> = IsTupleLike<T>;
template<typename T>
constexpr bool IsTupleLike<const volatile T> = IsTupleLike<T>;
2015-07-11 01:38:11 +00:00
2017-01-28 17:30:31 +00:00
template<typename ...A>
constexpr bool IsTupleLike<std::tuple<A...>> = true;
template<typename T, typename U>
constexpr bool IsTupleLike<std::pair<T, U>> = true;
2015-07-11 01:38:11 +00:00
2015-07-13 19:07:14 +00:00
} /* namespace ostd */
2015-07-11 01:38:11 +00:00
2016-02-07 21:17:15 +00:00
#endif