From: Omry Yadan Date: Thu, 20 Feb 2014 01:33:43 +0000 (-0800) Subject: allow folly Cursor to read and write floats X-Git-Tag: v0.22.0~691 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3a9422d1146085dcdef823dcbf703e7c59f4bf2a;p=folly.git allow folly Cursor to read and write floats Summary: and doubles! Test Plan: none really, will test later for now it compiles Reviewed By: tudorb@fb.com FB internal diff: D1175021 --- diff --git a/folly/io/Cursor.h b/folly/io/Cursor.h index bb0e5fdd..764f52a1 100644 --- a/folly/io/Cursor.h +++ b/folly/io/Cursor.h @@ -86,7 +86,7 @@ class CursorBase { } template - typename std::enable_if::value, T>::type + typename std::enable_if::value, T>::type read() { T val; pull(&val, sizeof(T)); @@ -409,7 +409,7 @@ template class Writable { public: template - typename std::enable_if::value>::type + typename std::enable_if::value>::type write(T value) { const uint8_t* u8 = reinterpret_cast(&value); Derived* d = static_cast(this); @@ -685,7 +685,7 @@ class QueueAppender : public detail::Writable { void ensure(uint64_t n) { queue_->preallocate(n, growth_); } template - typename std::enable_if::value>::type + typename std::enable_if::value>::type write(T value) { // We can't fail. auto p = queue_->preallocate(sizeof(T), growth_);