X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/03b35a9a1bd1f583e32b27d260b223a0989d6c75..e0c49ff6ba44cf5b47ab91d58b67763f5a1c7a58:/types.h diff --git a/types.h b/types.h index 7ab04cc..53f496d 100644 --- a/types.h +++ b/types.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -105,8 +106,8 @@ operator<<(std::ostream & o, const A & a) { return o << "[" << implode(a, ", ") << "]"; } -#include "verify.h" -#include "threaded_log.h" +#include +#define VERIFY(expr) { if (!(expr)) abort(); } // struct tuple adapter, useful for marshalling and endian swapping. usage: // @@ -116,8 +117,8 @@ operator<<(std::ostream & o, const A & a) { // }; #define MEMBERS(...) \ -inline auto _tuple_() -> decltype(std::tie(__VA_ARGS__)) { return std::tie(__VA_ARGS__); } \ -inline auto _tuple_() const -> decltype(std::tie(__VA_ARGS__)) { return std::tie(__VA_ARGS__); } +inline auto _tuple_() { return std::tie(__VA_ARGS__); } \ +inline auto _tuple_() const { return std::tie(__VA_ARGS__); } // struct ordering and comparison operations; requires the use of MEMBERS. // usage: @@ -132,24 +133,6 @@ LEXICOGRAPHIC_OPERATOR(_c_, <) LEXICOGRAPHIC_OPERATOR(_c_, <=) \ LEXICOGRAPHIC_OPERATOR(_c_, >) LEXICOGRAPHIC_OPERATOR(_c_, >=) \ LEXICOGRAPHIC_OPERATOR(_c_, ==) LEXICOGRAPHIC_OPERATOR(_c_, !=) -// Tuple indexing in variadic templates. -// This implementation of tuple_indices is redistributed under the MIT -// License as an insubstantial portion of the LLVM compiler infrastructure. - -template struct tuple_indices {}; -template struct make_indices_imp; -template struct make_indices_imp, E> { - typedef typename make_indices_imp, E>::type type; -}; -template struct make_indices_imp, E> { - typedef tuple_indices type; -}; -template struct make_tuple_indices { - typedef typename make_indices_imp, E>::type type; -}; - -#define TUPLE_INDICES(_ArgPack_) typename make_tuple_indices::type() - // Template parameter pack expansion is not allowed in certain contexts, but // brace initializers (for instance, calls to constructors of empty structs) // are fair game.