X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/26ade07ab0e62b98b452fbbd18edba0450035e35..ab6c1548ac2b1907bca92c8ce43e919c1a649a6f:/endian.h diff --git a/endian.h b/endian.h index f34d371..feb3bbd 100644 --- a/endian.h +++ b/endian.h @@ -20,14 +20,18 @@ inline int64_t hton(int64_t t) { return (int64_t)hton((uint64_t)t); } template inline T ntoh(T t) { return hton(t); } -template inline tuple::type...> +template +inline tuple::type...> tuple_hton_imp(tuple && t, tuple_indices) { - return tuple::type...>(hton(get(t))...); + return tuple< + typename std::remove_reference::type... + >(hton(std::get(t))...); } -template inline tuple::type...> +template +inline tuple::type...> hton(tuple && t) { - return tuple_hton_imp(forward>(t), TUPLE_INDICES(Args)); + return tuple_hton_imp(std::forward>(t), TUPLE_INDICES(Args)); } template inline typename