Avoid static_assert in tuple_element for Clang/libc++
authorPeter Griess <pgriess@fb.com>
Thu, 26 Sep 2013 02:07:50 +0000 (21:07 -0500)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:46:42 +0000 (18:46 -0700)
commit6bd1d4090a93820538af4235e24f187ec77ea49d
tree6cca4d0dc76b37703a9eb2e56f8db7601ad6ead8
parent3b3fa008590ee48a7490e5c71dd39ff5417c5f79
Avoid static_assert in tuple_element for Clang/libc++

Summary:
- Clang/libc++ has a static_assert that blows when tuple_element is
invoked with a tuple of length 0. Unfortunately if we embed this
construct in an enable_if, it still gets evaluated. To work around
this, wrap this in a last_element struct and specialize the 0-element
case there explicitly.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D998591
folly/Conv.h