Commit 9b7cf53d authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

No unnecessary SFINAE in ElfFile::at

Summary: [Folly] No unnecessary SFINAE in `ElfFile::at` - just use an explicit `static_assert` directly, rather than relying on overload resolution failure for the same goal.

Reviewed By: luciang

Differential Revision: D18746254

fbshipit-source-id: 4bb209bf3f563f2425e4532f6553e66856cb9bbb
parent 4b6ebaeb
......@@ -248,8 +248,8 @@ class ElfFile {
void validateStringTable(const ElfShdr& stringTable) const noexcept;
template <class T>
const typename std::enable_if<std::is_pod<T>::value, T>::type& at(
ElfOff offset) const noexcept {
const T& at(ElfOff offset) const noexcept {
static_assert(std::is_pod<T>::value, "non-pod");
if (offset + sizeof(T) > length_) {
char msg[kFilepathMaxLen + 128];
snprintf(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment