Refactor Endian
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 2 Mar 2017 05:20:44 +0000 (21:20 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 2 Mar 2017 05:21:31 +0000 (21:21 -0800)
commite473e0f9f9cc4fe10dc8920e8197c456e5c07140
treea840f047c8ed414348c7156dbe8d2d2bbec78b48
parent58285440f100065fcc2f4357507bfd6ac8efd463
Refactor Endian

Summary:
[Folly] Refactor `Endian`.

Define `swap` for all types, instead of only declaring it for all types, but have its implementation call a function that only has a given set of non-template overloads for a given set of supported types.

The effective change is that now `Endian::swap<std::string>` will fail to compile, rather than compile but fail to link.

And support floating-point types.

Reviewed By: nbronson

Differential Revision: D4615706

fbshipit-source-id: 5034e1e4466b8118a258d917ce8f4094460ca01a
folly/Bits.h
folly/test/BitsTest.cpp