diff options
Diffstat (limited to 'src/pair.h')
-rw-r--r-- | src/pair.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pair.h b/src/pair.h new file mode 100644 index 0000000..20bef4e --- /dev/null +++ b/src/pair.h @@ -0,0 +1,26 @@ +#ifndef TYPEASVALUE_SRC_PAIR_H_ +#define TYPEASVALUE_SRC_PAIR_H_ + +#include <type_traits> + +namespace tav { + +namespace detail { struct pair_tag { }; } + +template < + typename CAR, + typename CDR +> +struct Pair : detail::pair_tag { + typedef CAR car; + typedef CDR cdr; + + typedef Pair<CAR, CDR> type; +}; + +template <typename Type> +using IsPair = std::is_base_of<detail::pair_tag, Type>; + +} + +#endif // TYPEASVALUE_SRC_PAIR_H_ |